summaryrefslogtreecommitdiffstats
path: root/app/models/member_role.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-04 05:21:20 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-04 05:21:20 +0000
commit1de2c1c2af3672ffa6834e77e8c735152f760db9 (patch)
tree29103bcec0f0982756906f4c26236ad5a96f742a /app/models/member_role.rb
parent747afd808839bc1cf5815f63888fa25ed2384f4f (diff)
downloadredmine-1de2c1c2af3672ffa6834e77e8c735152f760db9.tar.gz
redmine-1de2c1c2af3672ffa6834e77e8c735152f760db9.zip
Rails3: model: replace deprecated validate method at member_role model
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8068 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/member_role.rb')
-rw-r--r--app/models/member_role.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/member_role.rb b/app/models/member_role.rb
index 8354b410f..a2c84020d 100644
--- a/app/models/member_role.rb
+++ b/app/models/member_role.rb
@@ -25,8 +25,9 @@ class MemberRole < ActiveRecord::Base
after_destroy :remove_role_from_group_users
validates_presence_of :role
+ validate :validate_role_member
- def validate
+ def validate_role_member
errors.add :role_id, :invalid if role && !role.member?
end