mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-30 20:51:18 +00:00
Skip validation if attribute did not change.
git-svn-id: http://svn.redmine.org/redmine/trunk@13851 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
e98e7c8c43
commit
0eda7765fa
@ -71,10 +71,10 @@ class Role < ActiveRecord::Base
|
|||||||
validates_length_of :name, :maximum => 30
|
validates_length_of :name, :maximum => 30
|
||||||
validates_inclusion_of :issues_visibility,
|
validates_inclusion_of :issues_visibility,
|
||||||
:in => ISSUES_VISIBILITY_OPTIONS.collect(&:first),
|
:in => ISSUES_VISIBILITY_OPTIONS.collect(&:first),
|
||||||
:if => lambda {|role| role.respond_to?(:issues_visibility)}
|
:if => lambda {|role| role.respond_to?(:issues_visibility) && role.issues_visibility_changed?}
|
||||||
validates_inclusion_of :users_visibility,
|
validates_inclusion_of :users_visibility,
|
||||||
:in => USERS_VISIBILITY_OPTIONS.collect(&:first),
|
:in => USERS_VISIBILITY_OPTIONS.collect(&:first),
|
||||||
:if => lambda {|role| role.respond_to?(:users_visibility)}
|
:if => lambda {|role| role.respond_to?(:users_visibility) && role.users_visibility_changed?}
|
||||||
|
|
||||||
# Copies attributes from another role, arg can be an id or a Role
|
# Copies attributes from another role, arg can be an id or a Role
|
||||||
def copy_from(arg, options={})
|
def copy_from(arg, options={})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user