I''ve been implementing CD review site. There is a two tiered category
System (i.e. Jazz > Hard Bop). Reviews can only be added in a sub-category
(i.e. Hard Bop). Write now I have this implemented in an adjacency list
schema with sub categories having parent_id and reviews having category_id.
\
IE.
- Jazz
- Hard Bop
- Review: foo
- Review : foo2
- Review: foo3
- Free
- Review: fooa
- Review : foob
- Review: fooc
- Fusion
The problem is, I want to be able to do something like this:
# Find a top level category
@cat = Category.find_by_name("Jazz")
#Get a collection of all the reviews associated with the sub-categories of a
toplevel
@all_reviews = @cat.reviews
In this case @all_reviews would have 6 objects in its collection.
Thanks for any help.
- Nathan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---