diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-07-23 11:26:04 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-07-23 11:26:04 +0000 |
commit | d74f0bfd5c53962e332c2dd4d30dafaa1105b92b (patch) | |
tree | f3eaf66d67c3a87fb34340561bf188d364de623c /app/models/enumeration.rb | |
parent | 41bb302594b48152b87c92f196c915f499093bbf (diff) | |
download | redmine-d74f0bfd5c53962e332c2dd4d30dafaa1105b92b.tar.gz redmine-d74f0bfd5c53962e332c2dd4d30dafaa1105b92b.zip |
Merged rails-5.1 branch (#23630).
git-svn-id: http://svn.redmine.org/redmine/trunk@16859 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/enumeration.rb')
-rw-r--r-- | app/models/enumeration.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb index eef691c4c..f330da085 100644 --- a/app/models/enumeration.rb +++ b/app/models/enumeration.rb @@ -29,8 +29,6 @@ class Enumeration < ActiveRecord::Base before_destroy :check_integrity before_save :check_default - attr_protected :type - validates_presence_of :name validates_uniqueness_of :name, :scope => [:type, :project_id] validates_length_of :name, :maximum => 30 @@ -148,7 +146,7 @@ class Enumeration < ActiveRecord::Base # position as the overridden enumeration def update_position super - if position_changed? + if saved_change_to_position? self.class.where.not(:parent_id => nil).update_all( "position = coalesce(( select position |