I originally tried to set it up that way and it works until I retrieve a
record from the database. I dont think it triggers the initialize
function. because I cant call the "wheels" method on an object after I
retrieve it.
--
Posted via http://www.ruby-forum.com/.
--
You received this message
Thanks for the Response Norm, That isn't necessary in this instance
though (all trucks will have 4 wheels). Should I just keep with what I
have?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group
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
3 matches
Mail list logo