Is there an easy way in ActiveRecord to fully delegate an attribute to an associated (has_one) model, including validations?
-
-
Replying to @avdi
Validations are an entirely separate thing that aren't tied to attributes FWIW
1 reply 0 retweets 1 like -
Replying to @sgrif
Any thoughts on having delegated attributes that are totally transparent from the POV of the view layer? I'm thinking about the fact that the delegating model won't expose validation errors on delegated fields.
2 replies 0 retweets 0 likes -
Replying to @avdi
It's an interesting idea. I have long been wanting to work on a feature called composed attributes, this could be a special case of that. Keep in mind that attributes also affect things like `where` but that sounds like a good thing for the case you're describing.
1 reply 0 retweets 1 like -
Replying to @sgrif
Mind you I'm not sure it's a GOOD idea, but a use case came up in a client session
1 reply 0 retweets 0 likes
The only thing about it that differs from a feature I definitely want to eventually have is that it needs access to associations. Every iteration on this I've taken, composed attributes only have access to other attributes not the model itself.
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.