aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_vault/attached/one.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/active_vault/attached/one.rb')
-rw-r--r--lib/active_vault/attached/one.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/active_vault/attached/one.rb b/lib/active_vault/attached/one.rb
index 5566c1b971..9bf83254c0 100644
--- a/lib/active_vault/attached/one.rb
+++ b/lib/active_vault/attached/one.rb
@@ -18,7 +18,16 @@ class ActiveVault::Attached::One < ActiveVault::Attached
end
def purge
- attachment.purge
- @attachment = nil
+ if attached?
+ attachment.purge
+ @attachment = nil
+ end
+ end
+
+ def purge_later
+ if attached?
+ attachment.purge_later
+ @attachment = nil
+ end
end
end