class ActiveStorage::Attached::Changes::PurgeMany

:nodoc:

def initialize(name, record, attachments)

def initialize(name, record, attachments)
  @name, @record, @attachments = name, record, attachments
end

def purge

def purge
  attachments.each(&:purge)
  reset
end

def purge_later

def purge_later
  attachments.each(&:purge_later)
  reset
end

def reset

def reset
  record.attachment_changes.delete(name)
  record.public_send("#{name}_attachments").reset
end