Module: Core::Io::Base::EagerLoadingBehaviour

Included in:
Core::Io::Base
Defined in:
app/api/core/io/base/eager_loading_behaviour.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details

#eager_loading_for(model) ⇒ Object


7
8
9
# File 'app/api/core/io/base/eager_loading_behaviour.rb', line 7

def eager_loading_for(model)
  model or raise StandardError, 'nil model does not make sense here at all!'
end

#set_eager_loadingObject


3
4
5
# File 'app/api/core/io/base/eager_loading_behaviour.rb', line 3

def set_eager_loading
  singleton_class.class_eval { define_method(:eager_loading_for) { |loaded_class| yield(super(loaded_class)) } }
end