module DbCharmer::ActiveRecord::Preloader::HasAndBelongsToMany

Public Instance Methods

records_for_with_db_magic(ids) click to toggle source
# File lib/db_charmer/rails31/active_record/preloader/has_and_belongs_to_many.rb, line 10
def records_for_with_db_magic(ids)
  if model.db_charmer_top_level_connection? || reflection.options[:polymorphic] ||
      model.db_charmer_default_connection != klass.db_charmer_default_connection
    records_for_without_db_magic(ids)
  else
    klass.on_db(model) do
      records_for_without_db_magic(ids)
    end
  end
end