首页 > 解决方案 > Using the paper_trail gem when a model has a UUID as primary key

问题描述

The model I want to track with paper_trail has a UUID as primary key. On save, the item_id in the version record is 0. So I changed the item_id's column type to uuid (I'm using Postgres) but now I'm getting the following error:

PG::InvalidTextRepresentation: ERROR: invalid input syntax for type uuid: "0" 

Is it even possible to use uuid's primary key for models tracked by paper_trail?

标签: ruby-on-railspaper-trail-gem

解决方案


推荐阅读