require 'much-plugin' module MR module Record include MuchPlugin plugin_included do extend ClassMethods include InstanceMethods end module InstanceMethods attr_writer :model def model @model ||= self.class.model_class.new(self) end def model_class self.class.model_class end end module ClassMethods attr_accessor :model_class end end end