Module: Sumaki::Model::Associations::AccessorAdder::Repeated

Defined in:
lib/sumaki/model/associations.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.add(methods_module, reflections, reflection) ⇒ Object



46
47
48
49
50
51
52
53
54
# File 'lib/sumaki/model/associations.rb', line 46

def add(methods_module, reflections, reflection)
  methods_module.module_eval <<~RUBY, __FILE__, __LINE__ + 1
    def #{reflection.name}                        # def book
      association(:#{reflection.name}).collection #   association(:book).collection
    end                                           # end
  RUBY

  reflections[reflection.name] = reflection
end