Module: EdgeRider::PreloadAssociations

Defined in:
lib/edge_rider/preload_associations.rb

Instance Method Summary collapse

Instance Method Details

#preload_associations(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/edge_rider/preload_associations.rb', line 4

def preload_associations(*args)
  preloader = ActiveRecord::Associations::Preloader

  if preloader.method_defined?(:preload) # Rails 4
    preloader.new.preload(*args)
  else
    preloader.new(*args).run
  end
end