diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-01 05:14:03 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-01 05:14:03 +0000 |
commit | 026c9e87c0640b28381d9b3277bb467905698972 (patch) | |
tree | fd0fc313c28f7ff738a57c47fc3b48e3fe25d8d6 /app | |
parent | 571ecf07e3e2ba0c9933dd34c4d563b44c1e5ffc (diff) | |
download | redmine-026c9e87c0640b28381d9b3277bb467905698972.tar.gz redmine-026c9e87c0640b28381d9b3277bb467905698972.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository/bazaar.rb | 7 | ||||
-rw-r--r-- | app/models/repository/cvs.rb | 8 | ||||
-rw-r--r-- | app/models/repository/darcs.rb | 7 | ||||
-rw-r--r-- | app/models/repository/filesystem.rb | 7 | ||||
-rw-r--r-- | app/models/repository/git.rb | 7 | ||||
-rw-r--r-- | app/models/repository/mercurial.rb | 7 |
6 files changed, 43 insertions, 0 deletions
diff --git a/app/models/repository/bazaar.rb b/app/models/repository/bazaar.rb index 9d7977e7e..d68fabc9a 100644 --- a/app/models/repository/bazaar.rb +++ b/app/models/repository/bazaar.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 diff --git a/app/models/repository/cvs.rb b/app/models/repository/cvs.rb index 1c479d1bb..e3dfced69 100644 --- a/app/models/repository/cvs.rb +++ b/app/models/repository/cvs.rb @@ -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 diff --git a/app/models/repository/darcs.rb b/app/models/repository/darcs.rb index dc3f0cee0..c6d7cafd0 100644 --- a/app/models/repository/darcs.rb +++ b/app/models/repository/darcs.rb @@ -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 diff --git a/app/models/repository/filesystem.rb b/app/models/repository/filesystem.rb index 4be6b5289..f06ad97c4 100644 --- a/app/models/repository/filesystem.rb +++ b/app/models/repository/filesystem.rb @@ -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 diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index 63faea668..fb5c26a7e 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -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 diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb index 98575a56b..021e60b0d 100644 --- a/app/models/repository/mercurial.rb +++ b/app/models/repository/mercurial.rb @@ -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 |