Module: SimpleActiveStorage::Attached::One

Defined in:
lib/simple_active_storage/attached.rb

Instance Method Summary collapse

Instance Method Details

#attach(attachable) ⇒ Object



25
26
27
28
29
30
# File 'lib/simple_active_storage/attached.rb', line 25

def attach(attachable)
  record.try(:before_active_storage_attach,attachable)
  result = super attachable
  record.try(:after_active_storage_attach,{name: name, attachment: attachment})
  result
end