Re: [Rails] Re: Simple Association Issue

2011-02-03 Thread Colin Law
On 2 February 2011 22:04, Chris Gallagher li...@ruby-forum.com wrote: Sure did: Sure did what? Please quote the previous post so each message makes sense. class User ActiveRecord::Base  has_many   :user_mailboxes  belongs_to :other_user, :class_name = UserMailbox That does not look

Re: [Rails] Re: Simple Association Issue

2011-02-02 Thread Colin Law
On 1 February 2011 23:01, Chris Gallagher li...@ruby-forum.com 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

[Rails] Re: Simple Association Issue

2011-02-02 Thread Chris Gallagher
Sure did: class User ActiveRecord::Base has_many :user_mailboxes belongs_to :other_user, :class_name = UserMailbox end class UserMailbox ActiveRecord::Base belongs_to :user belongs_to :other_user, :class_name = User end Very helpful guys, Thanks, Chris -- Posted via

[Rails] Re: Simple Association Issue

2011-02-01 Thread Robert Walker
There was recently a discussion of exactly the same scenario here: http://www.ruby-forum.com/topic/969712 That should answer your question. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To

[Rails] Re: Simple Association Issue

2011-02-01 Thread Chris Gallagher
Hi Fred, 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