Makes repository url read-only after saving.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9878 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -44,13 +44,15 @@ class Repository < ActiveRecord::Base
|
||||
validate :repo_create_validation, :on => :create
|
||||
|
||||
safe_attributes 'identifier',
|
||||
'url',
|
||||
'login',
|
||||
'password',
|
||||
'path_encoding',
|
||||
'log_encoding',
|
||||
'is_default'
|
||||
|
||||
safe_attributes 'url',
|
||||
:if => lambda {|repository, user| repository.new_record?}
|
||||
|
||||
def repo_create_validation
|
||||
unless Setting.enabled_scm.include?(self.class.name.demodulize)
|
||||
errors.add(:type, :invalid)
|
||||
|
||||
Reference in New Issue
Block a user