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

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

Instance Method Summary collapse

Instance Method Details

#eager_loading_for(model) ⇒ Object



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

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

#set_eager_loadingObject



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

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