Module: Stipend::Overrides

Defined in:
lib/stipend/overrides.rb

Instance Method Summary collapse

Instance Method Details

#override_inherited_model_name(overridden_model_name_class) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/stipend/overrides.rb', line 3

def override_inherited_model_name(overridden_model_name_class)
  class_eval <<-SOMETEXT
    def self.inherited(child)
      child.instance_eval do
        def model_name
          ::#{overridden_model_name_class}.model_name
        end
      end

      super
    end
  SOMETEXT
end