diff options
author | George Claghorn <george@basecamp.com> | 2018-07-13 12:17:33 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-07-13 12:17:33 -0400 |
commit | d20d6c732613dcc7276cb57d451e2a3bf573df19 (patch) | |
tree | d1af70d71ad09b3f688eb60dd094c5872af4eecd /activestorage/lib | |
parent | 63951072afc371e1393f3e185bee72e1bdcfdcfe (diff) | |
download | rails-d20d6c732613dcc7276cb57d451e2a3bf573df19.tar.gz rails-d20d6c732613dcc7276cb57d451e2a3bf573df19.tar.bz2 rails-d20d6c732613dcc7276cb57d451e2a3bf573df19.zip |
Fix that detaching could purge
Diffstat (limited to 'activestorage/lib')
-rw-r--r-- | activestorage/lib/active_storage/attached/many.rb | 2 | ||||
-rw-r--r-- | activestorage/lib/active_storage/attached/one.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activestorage/lib/active_storage/attached/many.rb b/activestorage/lib/active_storage/attached/many.rb index 204d6604c8..073cc013d8 100644 --- a/activestorage/lib/active_storage/attached/many.rb +++ b/activestorage/lib/active_storage/attached/many.rb @@ -41,7 +41,7 @@ module ActiveStorage # Deletes associated attachments without purging them, leaving their respective blobs in place. def detach - attachments.destroy_all if attached? + attachments.delete_all if attached? end ## diff --git a/activestorage/lib/active_storage/attached/one.rb b/activestorage/lib/active_storage/attached/one.rb index 960ff99e63..4a6bb1ffaa 100644 --- a/activestorage/lib/active_storage/attached/one.rb +++ b/activestorage/lib/active_storage/attached/one.rb @@ -45,7 +45,7 @@ module ActiveStorage # Deletes the attachment without purging it, leaving its blob in place. def detach if attached? - attachment.destroy + attachment.delete write_attachment nil end end |