Skip to content

Instantly share code, notes, and snippets.

John Ford iamjohnford

Block or report user

Report or block iamjohnford

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
iamjohnford / gist:c39e42d15e71702962ed111461b4b0c2
Created Jun 29, 2019
ActiveRecord::RecordNotUnique When Calling Active Storage attach
View gist:c39e42d15e71702962ed111461b4b0c2
ActiveRecord::RecordNotUnique in MessagesController#upload
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_active_storage_attachments_uniqueness"
DETAIL: Key (record_type, record_id, name, blob_id)=(Message, 1, images, 1271) already exists.
Extracted source (around line #661):
#659 log(sql, name, binds, type_casted_binds) do
#660 ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
*661 @connection.exec_params(sql, type_casted_binds)

Keybase proof

I hereby claim:

  • I am iamjohnford on github.
  • I am johnford ( on keybase.
  • I have a public key ASDz6Wg9AXknuYYlBFPJBrjsQU6yzuowL2e_naoM50KiWAo

To claim this, I am signing this object:

You can’t perform that action at this time.