Rails3: model: replace deprecated validate method at member model
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8047 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3d1e6f5b96
commit
23fd43374d
|
@ -24,6 +24,7 @@ class Member < ActiveRecord::Base
|
|||
|
||||
validates_presence_of :principal, :project
|
||||
validates_uniqueness_of :user_id, :scope => :project_id
|
||||
validate :validate_role
|
||||
|
||||
after_destroy :unwatch_from_permission_change
|
||||
|
||||
|
@ -81,7 +82,7 @@ class Member < ActiveRecord::Base
|
|||
|
||||
protected
|
||||
|
||||
def validate
|
||||
def validate_role
|
||||
errors.add_on_empty :role if member_roles.empty? && roles.empty?
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue