module Sequel::Plugins::SqlComments::DatasetMethods

Private Instance Methods

perform_eager_load(loader, eo) click to toggle source

Use SQL comments on eager load queries, showing they are eager loads.

Calls superclass method
# File lib/sequel/plugins/sql_comments.rb, line 180
def perform_eager_load(loader, eo)
  db.with_comments(:model=>model, :method_type=>:association_eager_load, :method=>nil, :association=>eo[:association]) do
    super
  end
end
prepare_eager_load(a, reflections, eager_assoc) click to toggle source

Add the association name as part of the eager load data, so #perform_eager_load has access to it.

Calls superclass method
# File lib/sequel/plugins/sql_comments.rb, line 169
def prepare_eager_load(a, reflections, eager_assoc)
  res = super
  
  reflections.each do |r|
    res[r[:eager_loader]][:association] = r[:name]
  end

  res
end