scm: add scm specific human_attribute_name for input validation.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4975 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-03-01 05:14:03 +00:00
parent 571ecf07e3
commit 026c9e87c0
6 changed files with 43 additions and 0 deletions

View File

@ -21,6 +21,13 @@ class Repository::Bazaar < Repository
attr_protected :root_url
validates_presence_of :url
ATTRIBUTE_KEY_NAMES = {
"url" => "Root directory",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
end
def self.scm_adapter_class
Redmine::Scm::Adapters::BazaarAdapter
end

View File

@ -21,6 +21,14 @@ require 'digest/sha1'
class Repository::Cvs < Repository
validates_presence_of :url, :root_url
ATTRIBUTE_KEY_NAMES = {
"url" => "CVSROOT",
"root_url" => "Module",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
end
def self.scm_adapter_class
Redmine::Scm::Adapters::CvsAdapter
end

View File

@ -20,6 +20,13 @@ require 'redmine/scm/adapters/darcs_adapter'
class Repository::Darcs < Repository
validates_presence_of :url
ATTRIBUTE_KEY_NAMES = {
"url" => "Root directory",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
end
def self.scm_adapter_class
Redmine::Scm::Adapters::DarcsAdapter
end

View File

@ -24,6 +24,13 @@ class Repository::Filesystem < Repository
attr_protected :root_url
validates_presence_of :url
ATTRIBUTE_KEY_NAMES = {
"url" => "Root directory",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
end
def self.scm_adapter_class
Redmine::Scm::Adapters::FilesystemAdapter
end

View File

@ -21,6 +21,13 @@ class Repository::Git < Repository
attr_protected :root_url
validates_presence_of :url
ATTRIBUTE_KEY_NAMES = {
"url" => "Path to repository",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
end
def self.scm_adapter_class
Redmine::Scm::Adapters::GitAdapter
end

View File

@ -26,6 +26,13 @@ class Repository::Mercurial < Repository
FETCH_AT_ONCE = 100 # number of changesets to fetch at once
ATTRIBUTE_KEY_NAMES = {
"url" => "Root directory",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
end
def self.scm_adapter_class
Redmine::Scm::Adapters::MercurialAdapter
end