Module: Dragonfly::Model::ClassMethods

Defined in:
lib/dragonfly/model/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#dragonfly_attachment_classesObject


10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dragonfly/model/class_methods.rb', line 10

def dragonfly_attachment_classes
  @dragonfly_attachment_classes ||= begin
    parent_class = ancestors.select{|a| a.is_a?(Class) }[1]
    if parent_class.respond_to?(:dragonfly_attachment_classes)
      parent_class.dragonfly_attachment_classes.map do |klass|
        new_dragonfly_attachment_class(klass.attribute, klass.app, klass.config_block)
      end
    else
      []
    end
  end
end