Quoting Adam <email@example.com>:
I have a problem with belongs_to and has_many, the thing is
i have a category table which points to herself if it's a subcategory
of another category.
I just started using ruby on rails, and don't know how to implement
that or if it can be done (I assume it can).
Look at acts_as_tree. It's a plugin in Rails 2.0, builtin in Rails 1.2.
class Task < ActiveRecord::Base
has_many :comments, :dependent=>:destroy
class Comment < ActiveRecord::Base
Tasks have a hierarchy of comments with replies and replies can have replies
task = Task.find(id)
task.comments # top level comments
task.comments.comments # replies to first top level comment
comment is like a category, reply is like a sub-category.