ruby-on-rails - 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?
解决方案
推荐阅读
- python - 同时运行多个 jpynb 文件
- javascript - 如何使用图像触发覆盖
- c# - 如何加载包含来自 HTTP 内容的数据的列表?
- c++ - 从属模板名称和 C++20 ADL
- amazon-web-services - 如何通过 ID 检查 API Gateway 部署内容
- dependency-injection - JSR 352 - Java 批处理 - 无法在侦听器工件中注入服务 bean 或 DAO
- android - AndroidStudio 和 Kotlin 无法访问“android.app.Activity”
- javascript - 如何使用护照本地猫鼬将多个对象保存到数据库?
- c# - Visual Studio 中的某些项目拒绝构建,即使我尝试手动构建它们
- javascript - 根据其他对象数组过滤对象数组