Sha256: c1bb787a56d13921f3c3566c3ba12222407d936c68354f0fe9acdfd43a6996ab
Contents?: true
Size: 709 Bytes
Versions: 2
Compression:
Stored size: 709 Bytes
Contents
# Patch for paperclip >= 3.5.0 (based on 6.1.0) module Paperclip class HasAttachedFile private # Overwrite so it doesn't add a :before_destroy filter - we want to handle that in # {Paperclip::PermanentRecords::ActiveRecord#destroy} instead def add_active_record_callbacks name = @name @klass.send(:after_save) { send(name).send(:save) } # @klass.send(:before_destroy) { send(name).send(:queue_all_for_delete) } if @klass.respond_to?(:after_commit) @klass.send(:after_commit, on: :destroy) do send(name).send(:flush_deletes) end else @klass.send(:after_destroy) { send(name).send(:flush_deletes) } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
paperclip-permanent_records-0.6.0 | lib/paperclip/permanent_records/paperclip_patch.rb |
paperclip-permanent_records-0.5.0 | lib/paperclip/permanent_records/paperclip_patch.rb |