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
pull/351/head
Toshi MARUYAMA 14 years ago committed by Eric Davis
parent 8eaa4d10e5
commit 9c3c35e8b8
  1. 7
      app/models/repository/bazaar.rb
  2. 8
      app/models/repository/cvs.rb
  3. 7
      app/models/repository/darcs.rb
  4. 7
      app/models/repository/filesystem.rb
  5. 7
      app/models/repository/git.rb
  6. 7
      app/models/repository/mercurial.rb

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

Loading…
Cancel
Save