Module: Paperclip::ClassMethods

Defined in:
lib/paperclip/has_attached_file_override.rb

Instance Method Summary collapse

Instance Method Details

#add_attachment_attributes(name, options) ⇒ Object



8
9
10
11
# File 'lib/paperclip/has_attached_file_override.rb', line 8

def add_attachment_attributes(name, options)
  @attachmets_recipes ||= {}
  @attachmets_recipes[name.to_sym] = options.fetch(:attributes, [])
end

#attachments_namesObject



17
18
19
# File 'lib/paperclip/has_attached_file_override.rb', line 17

def attachments_names
  attachmets_recipes.keys
end

#attachmets_recipesObject



13
14
15
# File 'lib/paperclip/has_attached_file_override.rb', line 13

def attachmets_recipes
  @attachmets_recipes || {}
end

#has_attached_file(name, options = {}) ⇒ Object



3
4
5
6
# File 'lib/paperclip/has_attached_file_override.rb', line 3

def has_attached_file(name, options = {})
  add_attachment_attributes(name, options)
  HasAttachedFile.define_on(self, name, options)
end