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
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
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
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
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
5 matches
Mail list logo