On Tue, Feb 14, 2012 at 05:05, Michael Pavling <[email protected]> wrote:

> You want to look online for "rails self referential associations"
>
> But essentially, in your User model add:
>  belongs_to :author, :class_name => "User"
>
> and add a migration for the author_id field to be added to the users table.

I think one of us (maybe more!) has misinterpreted what Marcos wanted.
 I think he wants to do that on Posts, not Users.  That way, each User
can post Posts from many different Authors, rather than each User
being able to attribute things to only one Author ever.

-Dave

-- 
Dave Aronson:  Available Cleared Ruby on Rails Freelancer
(NoVa/DC/Remote) -- see www.DaveAronson.com, and blogs at
www.Codosaur.us, www.Dare2XL.com, www.RecruitingRants.com

-- 
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