Rails 3 Abstract Class vs Inherited Class

Posted by R. Yanchuleff on Stack Overflow See other posts from Stack Overflow or by R. Yanchuleff
Published on 2011-03-02T15:03:56Z Indexed on 2011/03/02 15:24 UTC
Read the original article Hit count: 186

In my rails 3 model, I have two classes: Product, Service. I want both to be of type InventoryItem because I have another model called Store and Store has_many :InventoryItems

This is what I'm trying to get to, but I'm not sure how to model this in my InventoryItem model and my Product and Service models. Should InventoryItem just be a parent class that Product and Service inherit from, or should InventoryItem be modeled as a class abstract of which Product and Service extend from.

Thanks in advance for the advice!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails-3