Module: DbCharmer::ActiveRecord::Preloader::Association

Extended by:
ActiveSupport::Concern
Defined in:
lib/db_charmer/rails31/active_record/preloader/association.rb

Instance Method Summary collapse

Instance Method Details

#build_scope_with_db_magicObject



10
11
12
13
14
15
16
17
# File 'lib/db_charmer/rails31/active_record/preloader/association.rb', line 10

def build_scope_with_db_magic
  if model.db_charmer_top_level_connection? || reflection.options[:polymorphic] ||
      model.db_charmer_default_connection != klass.db_charmer_default_connection
    build_scope_without_db_magic
  else
    build_scope_without_db_magic.on_db(model)
  end
end