:acts_as_tree: http://wiki.rubyonrails.org/rails/pages/ActsAsTree
On Dec 7, 5:06 am, Ali <aalish...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi ,
> I am new to rails, and i need to know one thing, i have a table
> called Categories and i want to self join it in such a way , that one
> category could be a parent of many categories, but could be child of
> only one category.
>
> Please tell me how to tell rails , in my Category Model, does the
> following work for me ?
>
> class Category
>
> belongs_to :category
> has_many :categories
>
> end
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---