diff options
author | George Claghorn <george@basecamp.com> | 2018-07-13 14:48:45 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-07-13 14:48:45 -0400 |
commit | bd5eba1adff8fa72429f5889ae26097e9756ceb0 (patch) | |
tree | 22690f0a6db99483ee7c6556577abc2e3370eae7 /activestorage/lib | |
parent | 28db8ba60e726d695cf35710cc43ea45966464e9 (diff) | |
download | rails-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.rb | 4 |
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 |