How can i achieve this with rails? i want to make a join table with the same model, it is for colleagues so i want to have employee 1 with employee 2 maybe and 1 with 3... etc
so is this the best way to approach this in active records?
class Employee < ActiveRecords::Base
end
class Colleague < ActiveRecords::Base
has_many :employees, :foreign_key => 'employee_id'
has_many :colleague, :foreign_key => 'employee_id'
end
what you think? how should my migration be?
like this?
create_table :colleague do |t|
t.integer :employee_id
t.integer :colleague_id
end