Hello
I think this is the correct way of doing the contributor relations in
the agility tutorial:
[code]
has_many :contributor_memberships, :class_name =>
"ProjectMembership", :conditions => {:contributor => true}
has_many :contributors, :through
=> :contributor_memberships, :source => :user
[/code]
At least this seems to work fine.
/MartOn
On Feb 28, 3:30 am, tmorgan99 <[email protected]> wrote:
> I still don't know where this has+many+through thing is getting
> lost...
>
> I have found a work-around using yfactorial/utility_scopes:
>
> ---
> has_many :memberships ...
> has_many :contirbutorships ... :scope => :contributor
> ## as before, but replacing hmt relations with
> def members
> memberships.with( :user ).map &:user
> end
> defcontributors
> contributorships.with( :user ).map &:user
> end
>
> what do you think?
>
> On Feb 11, 9:32 am, Tom Locke <[email protected]> wrote:
>
> > > Does the Hobo scope thing work in :through relations?
> > > ...
>
> > That doesn't look right - will investigate.
>
> > Tom
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---