Module: Mongoid::Paperclip::ClassMethods

Defined in:
lib/mongoid/paperclip.rb

Instance Method Summary collapse

Instance Method Details

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


43
44
45
46
47
48
49
50
# File 'lib/mongoid/paperclip.rb', line 43

def has_attached_file(field, options = {})
  field(:"#{field}_file_name",    type: String)
  field(:"#{field}_content_type", type: String)
  field(:"#{field}_file_size",    type: Integer)
  field(:"#{field}_updated_at",   type: DateTime)

  __mongoid_has_attached_file(field, options)
end