summaryrefslogtreecommitdiffstats
path: root/lib/redmine/field_format.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-23 11:26:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-23 11:26:04 +0000
commitd74f0bfd5c53962e332c2dd4d30dafaa1105b92b (patch)
treef3eaf66d67c3a87fb34340561bf188d364de623c /lib/redmine/field_format.rb
parent41bb302594b48152b87c92f196c915f499093bbf (diff)
downloadredmine-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 'lib/redmine/field_format.rb')
-rw-r--r--lib/redmine/field_format.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb
index fade7c257..b59760674 100644
--- a/lib/redmine/field_format.rb
+++ b/lib/redmine/field_format.rb
@@ -972,7 +972,7 @@ module Redmine
end
def after_save_custom_value(custom_field, custom_value)
- if custom_value.value_changed?
+ if custom_value.saved_change_to_value?
if custom_value.value.present?
attachment = Attachment.where(:id => custom_value.value.to_s).first
if attachment
@@ -980,8 +980,8 @@ module Redmine
attachment.save!
end
end
- if custom_value.value_was.present?
- attachment = Attachment.where(:id => custom_value.value_was.to_s).first
+ if custom_value.value_before_last_save.present?
+ attachment = Attachment.where(:id => custom_value.value_before_last_save.to_s).first
if attachment
attachment.destroy
end