aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-13 14:48:45 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-13 14:48:45 -0400
commitbd5eba1adff8fa72429f5889ae26097e9756ceb0 (patch)
tree22690f0a6db99483ee7c6556577abc2e3370eae7 /activestorage/lib
parent28db8ba60e726d695cf35710cc43ea45966464e9 (diff)
downloadrails-bd5eba1adff8fa72429f5889ae26097e9756ceb0.tar.gz
rails-bd5eba1adff8fa72429f5889ae26097e9756ceb0.tar.bz2
rails-bd5eba1adff8fa72429f5889ae26097e9756ceb0.zip
Clear attachment changes on reload
Diffstat (limited to 'activestorage/lib')
-rw-r--r--activestorage/lib/active_storage/attached/model.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activestorage/lib/active_storage/attached/model.rb b/activestorage/lib/active_storage/attached/model.rb
index 1cdaac2e32..aa5c769cb8 100644
--- a/activestorage/lib/active_storage/attached/model.rb
+++ b/activestorage/lib/active_storage/attached/model.rb
@@ -132,5 +132,9 @@ module ActiveStorage
def attachment_changes #:nodoc:
@attachment_changes ||= {}
end
+
+ def reload(*) #:nodoc:
+ super.tap { @attachment_changes = nil }
+ end
end
end