2009/12/17 jeb <[email protected]>:
> I am not sure if I shall use single table inheritance, or something
> else.
>
> I have a model called horses, in that I have the columns mother_id and
> father_id where I of course intend to store the id of that horses
> mother and father. By that information alone I want to create a
> relation in the horses model for any horse to its mother and father. I
> wish to write something like @horse.mother.name
>
> I can't understand what to do with the type column in this case. This
> should really be quite simple I guess.

Have a look at the guide on ActiveRecord Associations at
http://guides.rubyonrails.org/ and the magic of Rails will become
clear.
Also, if you have not already done so work through the Getting Started guide.

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