Module: ActiveScaffold::Bridges::Dragonfly::Lib::DragonflyBridge

Defined in:
lib/active_scaffold/bridges/dragonfly/lib/dragonfly_bridge.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



18
19
20
# File 'lib/active_scaffold/bridges/dragonfly/lib/dragonfly_bridge.rb', line 18

def self.included(base)
  base.alias_method_chain :initialize, :dragonfly
end

Instance Method Details

#initialize_with_dragonfly(model_id) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/active_scaffold/bridges/dragonfly/lib/dragonfly_bridge.rb', line 6

def initialize_with_dragonfly(model_id)
  initialize_without_dragonfly(model_id)
  return unless self.model.respond_to?(:dragonfly_attachment_classes) && self.model.dragonfly_attachment_classes.present?
      
  self.update.multipart = true
  self.create.multipart = true
      
  self.model.dragonfly_attachment_classes.each do |attachment|
    configure_dragonfly_field(attachment.attribute)
  end
end