From 23fd43374d714e765bf0796ad22ecf3ab815fbc9 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 3 Dec 2011 14:33:49 +0000 Subject: 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 --- app/models/member.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/member.rb') 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 -- cgit v1.2.3