summaryrefslogtreecommitdiffstats
path: root/app/models/member.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-03 14:33:49 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-03 14:33:49 +0000
commit23fd43374d714e765bf0796ad22ecf3ab815fbc9 (patch)
tree7678926be8f0ab690568d3eef0de184c737d868f /app/models/member.rb
parent3d1e6f5b96d55f4b279d1a44ad8cbdb2b0a0612f (diff)
downloadredmine-23fd43374d714e765bf0796ad22ecf3ab815fbc9.tar.gz
redmine-23fd43374d714e765bf0796ad22ecf3ab815fbc9.zip
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
Diffstat (limited to 'app/models/member.rb')
-rw-r--r--app/models/member.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/member.rb b/app/models/member.rb
index 0e15935c2..4206ba446 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -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