Model inheritance with Merb no comments

Posted by stephane Thu, 21 Feb 2008 21:16:00 GMT

from help on irc#merb

I had recurrent issue about inherit a model class from another one in Merb, using ActiveRecord or DataMapper. As it’s ‘magicly’ done on Rails I though the same way in Merb, but the last one load model class in alpha order. then what you have to do is to load the first class with a require:

in your first file:

class Page < ActiveRecord::Base
end

then in second add the require:

require 'page'

class ActivePage < Page
end

Simply using ruby…