Class: ActiveRecord::Associations::Preloader

Inherits:
Object
  • Object
show all
Defined in:
lib/rcache/preloader.rb,
lib/rcache/association.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Association

Instance Method Summary collapse

Instance Method Details

#preload_hash(association) ⇒ Object



4
5
6
7
8
9
# File 'lib/rcache/preloader.rb', line 4

def preload_hash(association)
  association.each do |parent, child|
    Preloader.new(records, parent, options).run
    Preloader.new(records.map { |record| record.send(parent) }.flatten, child, options.select { |k,v| k == :rcache_value }).run
  end
end