class ReplicaPools::Config

Attributes

defaults_to_leader[RW]

When true, all queries will go to leader unless wrapped in with_pool{}. When false, all safe queries will go to the current replica unless wrapped in with_leader{}. Defaults to false.

disable_leader[RW]

When true, the leader database will not be selectable. Defaults to false.

environment[RW]

The current environment. Normally set to Rails.env, but will default to 'development' outside of Rails apps.

safe_methods[RW]

The list of methods considered safe to send to a readonly connection. Defaults are based on Rails version.

Public Class Methods

new() click to toggle source
# File lib/replica_pools/config.rb, line 20
def initialize
  @environment        = 'development'
  @defaults_to_leader = false
  @disable_leader     = false
  @safe_methods       = []
end