diff options
Diffstat (limited to 'lib/active_vault/attached/macros.rb')
-rw-r--r-- | lib/active_vault/attached/macros.rb | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/active_vault/attached/macros.rb b/lib/active_vault/attached/macros.rb deleted file mode 100644 index 1b95c14c9c..0000000000 --- a/lib/active_vault/attached/macros.rb +++ /dev/null @@ -1,23 +0,0 @@ -module ActiveVault::Attached::Macros - def has_one_attached(name, dependent: :purge_later) - define_method(name) do - instance_variable_get("@active_vault_attached_#{name}") || - instance_variable_set("@active_vault_attached_#{name}", ActiveVault::Attached::One.new(name, self)) - end - - if dependent == :purge_later - before_destroy { public_send(name).purge_later } - end - end - - def has_many_attached(name, dependent: :purge_later) - define_method(name) do - instance_variable_get("@active_vault_attached_#{name}") || - instance_variable_set("@active_vault_attached_#{name}", ActiveVault::Attached::Many.new(name, self)) - end - - if dependent == :purge_later - before_destroy { public_send(name).purge_later } - end - end -end |