I have a few models – book, cd, dvd – for which I’d like to have an
abstract base superclass to hold some common stuff. That abstract class,
was thinking, would inherit from ActiveRecord.
Didn’t work, though, and looking around, I found this:
pretty hackish to me. Is there any best way or recommendations on how to
achieve this kind of behavior? I know I could modify ActiveRecord
but that seems brittle – to run my app on later versions of rails, I’d
to remember to re-modify ActiveRecord.
What’s really brittle, though, is my brain. This is my first RoR app,
parts of rails (convention over config, built-in ORM and testing) I
immediately loved. But some stuff seems like it would be, well, [puts on
fireproof suit] easier in Java. I’m still sort of waiting for it all to
together in my mind.
Anyways, apologies for being a dunce. Any guidance on how to best handle
abstract base class question would be much appreciated.