Module: Dragonfly::ActiveModelExtensions::InstanceMethods

Defined in:
lib/dragonfly/active_model_extensions/instance_methods.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) dragonfly_attachments



5
6
7
8
9
10
# File 'lib/dragonfly/active_model_extensions/instance_methods.rb', line 5

def dragonfly_attachments
  @dragonfly_attachments ||= self.class.dragonfly_attachment_classes.inject({}) do |hash, klass|
    hash[klass.attribute] = klass.new(self)
    hash
  end
end