On 14 Feb, 13:55, "Jon"
<jdelStrot...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Has anyone tried creating proxies in their association extensions?
>
> For example, Jamis talks about extensions here - http://
> weblog.jamisbuck.org/2007/1/9/extending-activerecord-associations
> There''s an ''active'' method, which returns the
results of a find
> operation. But say I need to count those active items. I could add a
> count_active method... but it seems like it would be much cleaner if
> the active method returned an association proxy. That way, a simple
> project.tasks.active could be queried for the full range of proxy
> methods - eg project.tasks.active.count, or
> project.tasks.active.find_by_name.
>
> The association proxy setup code is making my head spin right now, so
> I haven''t tried it - has anyone else?
That''s a no, then?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---