On 1 February 2011 23:01, Chris Gallagher <[email protected]> wrote:
> Hi Fred,

Please quote the previous message so that the thread is easier to follow.

>
> So that means in my user model I can associate by using the following?
>
> belongs_to :other_user, :class_name => "UserMailbox"
>
> But what about when I want to go back the other way? So I have the
> mailbox object which has the field "other_user_id" but how do I create
> the association between this ID and the ID in the users table which is
> its primary key (id)?

Did you read through the thread referenced by Robert?  Did you work
right through and understand everything there?  (Particularly note the
use of foreign_key).

Colin

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to