21 Feb

Model inheritance with Merb

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…

tags: merb (3) ruby (22) datamapper (1) inherit (1) activerecord (1)