Sha256: b2f1c96df39e28b03eaf442e15487e41f87b8abc67ccc6881936ceceb15f3d17
Contents?: true
Size: 538 Bytes
Versions: 71
Compression:
Stored size: 538 Bytes
Contents
# frozen_string_literal: true module ActiveStorage class Attached::Changes::PurgeOne # :nodoc: attr_reader :name, :record, :attachment def initialize(name, record, attachment) @name, @record, @attachment = name, record, attachment end def purge attachment&.purge reset end def purge_later attachment&.purge_later reset end private def reset record.attachment_changes.delete(name) record.public_send("#{name}_attachment=", nil) end end end
Version data entries
71 entries across 68 versions & 6 rubygems