Sha256: 366f81e55d6586a1a2a1ffb5c2896d24399790cfa22da8f45150704d6c36506d
Contents?: true
Size: 627 Bytes
Versions: 11
Compression:
Stored size: 627 Bytes
Contents
module Dragonfly module ActiveRecordExtensions 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
11 entries across 11 versions & 1 rubygems