Module: Transit::Model::Attachments::ClassMethods
- Defined in:
- lib/transit/model/attachments.rb
Instance Method Summary collapse
-
#attach(name, options = {}) ⇒ Object
Convenience method for Paperclip’s has_attached_file to ensure fields also exist.
Instance Method Details
#attach(name, options = {}) ⇒ Object
Convenience method for Paperclip’s has_attached_file to ensure fields also exist.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/transit/model/attachments.rb', line 35 def attach(name, = {}) if [:styles].present? .reverse_merge!(original: '1500x1500>') end has_attached_file name, field :"#{name.to_s}_file_name", :type => String field :"#{name.to_s}_content_type", :type => String field :"#{name.to_s}_file_size", :type => Integer field :"#{name.to_s}_updated_at", :type => Time field :"#{name.to_s}_fingerprint", :type => String end |