Forum: Ruby on Rails nuby: do models have to inherit directly from ActiveRecord?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Eric H. (Guest)
on 2006-01-14 12:37
(Received via mailing list)
On Jan 14, 2006, at 12:11 AM, removed_email_address@domain.invalid wrote:

> how to
> achieve this kind of behavior? I know I could modify ActiveRecord
> directly,
> but that seems brittle -- to run my app on later versions of rails,
> I'd have
> to remember to re-modify ActiveRecord.

That's how you do it.

> What's really brittle, though, is my brain. This is my first RoR
> app, and
> 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 come
> together in my mind.

A few things are harder than they should be, like subclassing
ActiveRecord::Base.  Rather than make the common thing easy,
ActiveRecord reserves subclassing for a seldom-used feature.

> Anyways, apologies for being a dunce. Any guidance on how to best
> handle the
> abstract base class question would be much appreciated.

Bite the bullet and add those methods.

Eric H. - removed_email_address@domain.invalid -
This implementation is HODEL-HASH-9600 compliant
This topic is locked and can not be replied to.