aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/attached/one.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-13 12:17:33 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-13 12:17:33 -0400
commitd20d6c732613dcc7276cb57d451e2a3bf573df19 (patch)
treed1af70d71ad09b3f688eb60dd094c5872af4eecd /activestorage/lib/active_storage/attached/one.rb
parent63951072afc371e1393f3e185bee72e1bdcfdcfe (diff)
downloadrails-d20d6c732613dcc7276cb57d451e2a3bf573df19.tar.gz
rails-d20d6c732613dcc7276cb57d451e2a3bf573df19.tar.bz2
rails-d20d6c732613dcc7276cb57d451e2a3bf573df19.zip
Fix that detaching could purge
Diffstat (limited to 'activestorage/lib/active_storage/attached/one.rb')
-rw-r--r--activestorage/lib/active_storage/attached/one.rb2
1 files changed, 1 insertions, 1 deletions
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