Sha256: e6fa4e711591e30ce717d6fe598584e3edc6d6f3a8568b65c1aa43a39e27250f
Contents?: true
Size: 626 Bytes
Versions: 12
Compression:
Stored size: 626 Bytes
Contents
module Dragonfly module ActiveModelExtensions module InstanceMethods def attachments @attachments ||= self.class.dragonfly_apps_for_attributes.inject({}) do |hash, (attribute, app)| hash[attribute] = Attachment.new(app, self, attribute) hash end end private def save_attachments attachments.each do |attribute, attachment| attachment.save! end end def destroy_attachments attachments.each do |attribute, attachment| attachment.destroy! end end end end end
Version data entries
12 entries across 12 versions & 2 rubygems