Displaying 1 result from an estimated 1 matches for "aalish".
Did you mean:
kalish
2008 Dec 07
1
How to describe self join in a model
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