Rails 3 HABTM Strange Association: Project and Employee in a tree.
- by Mauricio
Hi guys I have to adapt an existing model to a new relation. I have this:
A Project has many Employees.
the Employees of a Project are organized in some kind of hierarchy (nothing fancy, I resolved this adding a parent_id for each employee to build the 'tree')
class Employee < AR:Base
belongs_to :project
belongs_to :parent, :class_name…