Re: [Rails] Class design Help!

2013-05-25 Thread Norm Scherer
Maybe you have a particular limited set of vehicles but trucks I know have from 4 to 10 (or more) wheels and motorcycles have 2 or 3 wheels and Semi-trailer trucks have 10 to 20 (or more) wheels depending on application. I would store the number of wheels in the database. Norm On 05/24/2013

[Rails] Class design Help!

2013-05-24 Thread oliver bee
I have 3 classes ("Truck", "Semi", "Motorcycle") that all inherit from the "Vehicle" class. Each subclass has an attribute for "Wheels" that tells how many wheels the vehicle has (I do not store these values in the database because they will never change) I'm wondering what is the preferred method