Sha256: 1b48816575adafd2449a853868236fd61d578406bb9689acb3c96d845403181f

Contents?: true

Size: 516 Bytes

Versions: 4

Compression:

Stored size: 516 Bytes

Contents

module ModulesInRenderHierarchy

  def self.included klass
    klass.extend ClassMethods
    klass.metaclass.alias_method_chain :include, :superclass_override
  end

  module ClassMethods
    def include_with_superclass_override mod
      original_superclass = superclass
      self.send :include_without_superclass_override, mod
      mod.metaclass.send :define_method, :superclass do
        original_superclass
      end
      metaclass.send :define_method, :superclass do
        mod
      end
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
view_models-2.0.1 lib/rails2/lib/experimental/modules_in_render_hierarchy.rb
view_models-2.0.0.ruby19 lib/rails2/lib/experimental/modules_in_render_hierarchy.rb
view_models-2.0.0 lib/rails2/lib/experimental/modules_in_render_hierarchy.rb
view_models-1.5.7 lib/experimental/modules_in_render_hierarchy.rb