Module: Flattener::Reset

Defined in:
lib/has_helpers/flattener/reset.rb

Overview

When included this module removes the dependencies of Flattener::Base on the table underlying the model class by essentially wiping the slate and starting from an empty set of columns and associations. Think of it as the equivalent of reset.css for flatteners. This is useful for cases where data warehouse table does not correspond very directly to a transactional table or model.

Include this module into a flattener class:

class MyFlattener < Flattener::Base
include Flattener::Reset
# Yay, columns and associations are empty and ready to be configured!
# ...
end

Defined Under Namespace

Modules: ClassInstanceMethods

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



19
20
21
# File 'lib/has_helpers/flattener/reset.rb', line 19

def self.included(klass)
  klass.singleton_class.prepend(ClassInstanceMethods)
end