-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
I tried to use UUIDs for my taggable object resulting in
ActiveRecord::StatementInvalid: PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "b8cc337e-8535-4115-b782-e261c4cfa32a"
: SELECT "gutentag_tags".* FROM "gutentag_tags" INNER JOIN "gutentag_taggings" ON "gutentag_tags"."id" = "gutentag_taggings"."tag_id" WHERE "gutentag_taggings"."taggable_id" = $1 AND "gutentag_taggings"."taggable_type" = $2
trying to debug it now. found the problem.
Had to modify the generated migration from
create_table :gutentag_taggings do |t|
t.integer :tag_id, null: false
t.integer :taggable_id, null: false
t.string :taggable_type, null: false
t.timestamps null: false
end
to
create_table :gutentag_taggings do |t|
t.integer :tag_id, null: false
t.uuid :taggable_id, null: false
t.string :taggable_type, null: false
t.timestamps null: false
end
Metadata
Metadata
Assignees
Labels
No labels