You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Neo4J, which uses this gem for attribute declaration.
I'm also building a Rails app that uses UUIDs as primary keys in my Postgres database. I would like to be able to reference these primary keys, e.g. user_id, and have them be of the UUID type.
This could look something like:
class Node
include ActiveAttr::TypecastedAttributes
attribute :user_id, type: UUID
end
Currently, I'm using type: String, but that doesn't ensure that the given value is actually a UUID, and I have to write Active Model validators to ensure this, which is a bit of a pain.
Any pointers on where to start working on a PR is much appreciated. Thanks.
The text was updated successfully, but these errors were encountered:
ekampp
added a commit
to ekampp/active_attr
that referenced
this issue
Oct 31, 2019
This introduces a UUID typecasting option, which effectively functions as a string, but coerced to nil unless the string exactly matches the UUID pattern.
This fixes issue cgriego#174
Hi there.
I'm using Neo4J, which uses this gem for attribute declaration.
I'm also building a Rails app that uses UUIDs as primary keys in my Postgres database. I would like to be able to reference these primary keys, e.g.
user_id
, and have them be of the UUID type.This could look something like:
Currently, I'm using
type: String
, but that doesn't ensure that the given value is actually a UUID, and I have to write Active Model validators to ensure this, which is a bit of a pain.Any pointers on where to start working on a PR is much appreciated. Thanks.
The text was updated successfully, but these errors were encountered: