On Thu, Nov 5, 2009 at 4:23 PM, Aljaz Fajmut <
[email protected]> wrote:

>
> Hello,
>
> Suppose I have 2 models Human and Person and I want to inherit one from
> another so that I could use 'human' model/migration as a generic builder
> for smiliar objects as 'person', for instance this with the following
> table structure:
>
> human table:
> id
> weight
> size
>
> person table:
> id
> name
> surname
> address
>
> Is it possible to make such table inheritance in rails to be able to
> have 'base' model for those that are submodels with different columns?
>
> Thanks in advance!
>

Yes, this is possible in Rails.  Thus, you can read section 19.4 of AWDwR
3rd edition.  It
provides an excellent example of what one would do to achieve table
inheritance in Rails.

Good luck,

-Conrad


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