##// END OF EJS Templates
Skip validation if attribute did not change....
Jean-Philippe Lang -
r13469:0eda7765fa55
parent child
Show More
@@ -71,10 +71,10 class Role < ActiveRecord::Base
71 validates_length_of :name, :maximum => 30
71 validates_length_of :name, :maximum => 30
72 validates_inclusion_of :issues_visibility,
72 validates_inclusion_of :issues_visibility,
73 :in => ISSUES_VISIBILITY_OPTIONS.collect(&:first),
73 :in => ISSUES_VISIBILITY_OPTIONS.collect(&:first),
74 :if => lambda {|role| role.respond_to?(:issues_visibility)}
74 :if => lambda {|role| role.respond_to?(:issues_visibility) && role.issues_visibility_changed?}
75 validates_inclusion_of :users_visibility,
75 validates_inclusion_of :users_visibility,
76 :in => USERS_VISIBILITY_OPTIONS.collect(&:first),
76 :in => USERS_VISIBILITY_OPTIONS.collect(&:first),
77 :if => lambda {|role| role.respond_to?(:users_visibility)}
77 :if => lambda {|role| role.respond_to?(:users_visibility) && role.users_visibility_changed?}
78
78
79 # Copies attributes from another role, arg can be an id or a Role
79 # Copies attributes from another role, arg can be an id or a Role
80 def copy_from(arg, options={})
80 def copy_from(arg, options={})
General Comments 0
You need to be logged in to leave comments. Login now