module PgpoolNoLoadBalance

Constants

NLB_COMMENT
VERSION

Public Class Methods

setup!() click to toggle source
# File lib/pgpool_no_load_balance.rb, line 14
def self.setup!
  unless ::ActiveRecord::Base.respond_to?(:postgresql_connection)
    raise PostgreSQLAdapterMissing, "No postgresql adapter specified by 'config/database.yml', or 'ActiveRecord::Base.establish_connection' method is not called."
  end
  ::ActiveRecord::Base.extend PgpoolNoLoadBalance::ActiveRecord::Querying
  ::ActiveRecord::Relation.prepend PgpoolNoLoadBalance::ActiveRecord::QueryMethods
  ::ActiveRecord::Relation::VALID_UNSCOPING_VALUES << :pgpool_nlb
  ::Arel::SelectManager.include PgpoolNoLoadBalance::Arel::SelectManager
  ::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend PgpoolNoLoadBalance::ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
  ::ActiveRecord::ExplainSubscriber.prepend PgpoolNoLoadBalance::ActiveRecord::ExplainSubscriber
end