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/version.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/version.rb')
-rw-r--r-- | app/models/version.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/version.rb b/app/models/version.rb index b48938913..4c559dcad 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -39,7 +39,6 @@ class Version < ActiveRecord::Base validates :effective_date, :date => true validates_inclusion_of :status, :in => VERSION_STATUSES validates_inclusion_of :sharing, :in => VERSION_SHARINGS - attr_protected :id scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)} scope :like, lambda {|arg| @@ -302,10 +301,10 @@ class Version < ActiveRecord::Base # Update the issue's fixed versions. Used if a version's sharing changes. def update_issues_from_sharing_change - if sharing_changed? - if VERSION_SHARINGS.index(sharing_was).nil? || + if saved_change_to_sharing? + if VERSION_SHARINGS.index(sharing_before_last_save).nil? || VERSION_SHARINGS.index(sharing).nil? || - VERSION_SHARINGS.index(sharing_was) > VERSION_SHARINGS.index(sharing) + VERSION_SHARINGS.index(sharing_before_last_save) > VERSION_SHARINGS.index(sharing) Issue.update_versions_from_sharing_change self end end |