Module: RailsForceReload::DefineReaders

Included in:
RailsForceReload
Defined in:
lib/rails-force-reload/rails-force-reload.rb

Instance Method Summary collapse

Instance Method Details

#define_readers(mixin, name) ⇒ Object

this method changed in 5.2.0 to strip arguments See commit 39f6c6c641f0c92c532e0c3747d1536af657920f



8
9
10
11
12
13
14
# File 'lib/rails-force-reload/rails-force-reload.rb', line 8

def define_readers(mixin, name)
  mixin.class_eval <<-CODE, __FILE__, __LINE__ + 1
    def #{name}(*args)
      association(:#{name}).reader(*args)
    end
  CODE
end