class ActiveStorage::Attached::Changes::CreateOneOfMany

:nodoc:

def find_attachment

def find_attachment
  if blob.persisted?
    record.public_send("#{name}_attachments").detect { |attachment| attachment.blob_id == blob.id }
  else
    blob.attachments.find { |attachment| attachment.record == record }
  end
end