Module: Polypaperclip::InstanceMethods
- Defined in:
- lib/polypaperclip.rb
Instance Method Summary collapse
-
#each_attachment ⇒ Object
we override Paperclip’s each_attachment so that we proxy through the attachments model.
- #paperclip_attachment_for(name) ⇒ Object
- #save_attached_files ⇒ Object
Instance Method Details
#each_attachment ⇒ Object
we override Paperclip’s each_attachment so that we proxy through the attachments model
73 74 75 76 77 |
# File 'lib/polypaperclip.rb', line 73 def self.class.polypaperclip_definitions.each do |name, definition| yield(name, (name)) end end |
#paperclip_attachment_for(name) ⇒ Object
90 91 92 93 94 95 |
# File 'lib/polypaperclip.rb', line 90 def (name) @_paperclip_attachments ||= {} @_paperclip_attachments[name] ||= Polypaperclip::Attachment.new(name, self, self.class.polypaperclip_definitions[name]) end |
#save_attached_files ⇒ Object
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/polypaperclip.rb', line 79 def save_attached_files #premptively save each attachment Paperclip.log("Saving attachments.") do |name, | if && .instance .instance.save .send(:save) end end end |