Two fields associated to the same table

Hello,

I have a model that contains two fields associated with the same table,
I hooked one up using the standard has_many association but I have no
clue on how to do the second one.
here are my models

class Task < ActiveRecord::Base
belongs_to :user #works fine associating through the user_id field in
the table

belongs_to :user2

#I don’t know what to place here, but I need to associate field
resquester_id to #the users tables too

end

class User < ActiveRecord::Base
has_many :tasks
end

appreciate any help
Coelho

you need 2 foriegn keys. Then add the :foriegn_key => :user2_id to
has_many and belongs_to

On Aug 8, 1:05 pm, coelho coelho [email protected]