search for: howtomakeabstractmodel

Displaying 2 results from an estimated 2 matches for "howtomakeabstractmodel".

2006 Jan 14
11
nuby: do models have to inherit directly from ActiveRecord?
...w models -- book, cd, dvd -- for which I''d like to have an abstract base superclass to hold some common stuff. That abstract class, I was thinking, would inherit from ActiveRecord. Didn''t work, though, and looking around, I found this: <http://wiki.rubyonrails.com/rails/pages/HowtoMakeAbstractModel> http://wiki.rubyonrails.com/rails/pages/HowtoMakeAbstractModel. Which looks 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 directly, but that seems brittle -- to run my app on later versions of rails, I&...
2006 Jan 17
10
Is STI the only way to do inheritance?
I''m currently coding a system which must store multiple contact methods for a user (phone, email, postal address etc). I''m planning a fairly straightforward inheritance hierachy for these, where each different method inherits from something like a ContactMethod class. The only mention of ActiveRecord support for inheritance I can find in the Wiki and the Agile Web Dev book is