On Nov 9, 2009, at 5:45 PM, christian wrote:
> Genre in my case is a seperate model which both user and submissions
> has many and I want to sort by submissions genre.
>
> Genre has many submissions and users. Submissions belong to genre.
>
> So for this example would it be?
>
> class Submission
> named_scope :prose, :include => :genre, :conditions =>
> { :submissions =>
> { :genre => 'Prose' } }
> end
>
That's not going to work - my examples assumed (since you were
referencing users.genre) that genre was a field (likely an
enum_string) that was defined on User.
Can you post the relevant parts of your models, either here or in a
gist?
> Thank you. I feel I already understand the process much better and I
> have been reading the linked tutorials which I am catching things
> that didn't quite make sense before.
:) As rough as things sometimes are now, just imagine what it was like
back in the old 0.6 era; most of the documentation back then was "read
the source". Big thanks to everybody that's contributed recipes, docs,
or even just come on the list and said, "X doesn't make sense...".
--Matt Jones
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---