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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2006-01-14 11:37
(Received via mailing list)
On Jan 14, 2006, at 12:11 AM, rails-request@lists.rubyonrails.org 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 Hodel - drbrain@segment7.net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
This topic is locked and can not be replied to.