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 was surprised to see that both json and jsonb columns in postgres are mapped as T.untyped despite having popular usage. I couldn't find any discussions about this when searching the issues.
Question for maintainers: Are there any known gotchas for implementing this in a straightforward way compared to other types? I have some concerns here because it seems like if it isn't implemented there was a good reason for that, but I couldn't find a mention of that anywhere.
The text was updated successfully, but these errors were encountered:
I don't think using ActiveRecord::Type:: in a signature makes sense for setters and getters. Playing around a little bit I think we could do T::Hash[T.untyped, T.untyped] instead for json columns, it seems to be automatically serialized/deserialized. I assume it's similar for Postgres.
Yeah sorry it wasn't clear. ActiveRecord::Type::Json is the type used internally by ActiveRecord and the type that the compiler would be implementing. The signature output would be a form of T::Hash.
I was surprised to see that both json and jsonb columns in postgres are mapped as T.untyped despite having popular usage. I couldn't find any discussions about this when searching the issues.
json
=>ActiveRecord::Type::Json
jsonb
=>ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Jsonb
Question for maintainers: Are there any known gotchas for implementing this in a straightforward way compared to other types? I have some concerns here because it seems like if it isn't implemented there was a good reason for that, but I couldn't find a mention of that anywhere.
The text was updated successfully, but these errors were encountered: