Looking for examples or docs on using the #Rails 5 Attributes API for something backed by a `jsonb` (or even `json`) column. Help/RT?
-
-
Replying to @stevenharman
For example,
@erniemiller's, Link example: https://nvisium.com/blog/2015/06/22/using-rails-5-attributes-api-today-in/ … How would that look in Rails 5, proper? Is `jsonb` supported? /cc@sgrif2 replies 0 retweets 0 likes -
-
Replying to @sgrif
sorry, I wasn't very clear. I mean for a custom type, which is backed by jsonb. So `attribute :foo, Bar::http://Type.new `.
1 reply 0 retweets 0 likes -
Replying to @stevenharman @sgrif
does that make sense? I see the `AbstractJson` Type, which has a PG implementation. Would `Bar::Type` inherit from that?
1 reply 0 retweets 0 likes -
Replying to @stevenharman
No, it's not public API. You can inherit from the existing classes if you want, but it may break between versions
1 reply 0 retweets 0 likes -
Replying to @sgrif
is none of it is considered public? Or if some, how much? I'm guessing only the `attribute :foo` w/built-in types? No custom types?
2 replies 0 retweets 0 likes -
Replying to @stevenharman
No, the attributes API is public. The types in `ActiveRecord::Type` are also public (not `Internal` though)
2 replies 0 retweets 0 likes -
Replying to @sgrif
Any idea if this might come to the public API? Trying to figure out where to extend from (Value, AbstractJson, etc) in the mean time.
2 replies 0 retweets 0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.