Hi all,
I have a small problem with ActiveRecord and I was wondering if anyone can
help me.
I have 2 tables: users and activities and inside activities I have a foreign
key (user_id) to the user table. Everything is ok.
I want now to add another foreign key to users, called added_by_user_id.
I''ve changed the model to Activity:
belongs_to :user, :foreign_key => ''user_id''
belongs_to :user, :foreign_key => ''added_by_user_id''
but now activity.user is not defined anymore.
I was wondering if there is any way to ''map'' the users in
different
attributes of activity. I''ve checked the API but couldn''t
find anything.
Any help is much appreciated.
Cheers,
Paul
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---