It was always meant to be public API eventually. Implementation wasn't finished in 4.2. Too many pitfalls to make public
-
-
Replying to @sgrif
So can I use :value (or Type::Value) to opt out of typecasting? My attributes may be different types, but don't get persisted to db.
1 reply 0 retweets 0 likes -
Replying to @ravinggenius
Yes `Type::Value` is the identity type. (And I recommend always using the class names never the symbol form personally)
1 reply 0 retweets 0 likes -
Replying to @sgrif
Does it matter `ActiveModel::Type::Value` versus `ActiveRecord::Type::Value` matter? I have to call `.new` right?
1 reply 0 retweets 0 likes -
Replying to @ravinggenius
You need to call .new. You can just do `Type::http://Value.new `
1 reply 0 retweets 0 likes -
Replying to @sgrif
I tried that, but Ruby can't find `Type` correctly. :(
3 replies 0 retweets 0 likes -
Replying to @ravinggenius
So yeah you might need to do `ActiveModel::Type::http://Value.new `
1 reply 0 retweets 0 likes -
Replying to @sgrif
No worries! One more: I started using attribute instead of attr_accessor because it would show the attribute when inspecting... 1/n
3 replies 0 retweets 0 likes -
Replying to @ravinggenius
Oh you don't need to specify the type for that case. `attribute :foo` is the same as `Type::Value` if no existing type
1 reply 0 retweets 0 likes -
Replying to @sgrif
I tried this, but got an error. Not a blocker for me, but I thought you'd like to know. https://gist.github.com/ravinggenius/362c8a32f712f99714a18f2606f7e0bc …
1 reply 0 retweets 0 likes
Huh I could have sworn it was, but that appears to have never been true... https://github.com/rails/rails/commit/65c33009#diff-4c958c3c4be43e9896bd7d11ede1566aR60 …
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.