Module: ActiveRecordShards

Defined in:
lib/active_record_shards/sql_comments.rb,
lib/active_record_shards.rb,
lib/active_record_shards/model.rb,
lib/active_record_shards/tasks.rb,
lib/active_record_shards/migration.rb,
lib/active_record_shards/shard_support.rb,
lib/active_record_shards/shard_selection.rb,
lib/active_record_shards/connection_switcher.rb,
lib/active_record_shards/configuration_parser.rb,
lib/active_record_shards/connection_switcher-5-1.rb,
lib/active_record_shards/connection_switcher-6-0.rb,
lib/active_record_shards/default_replica_patches.rb,
lib/active_record_shards/schema_dumper_extension.rb,
lib/active_record_shards/association_collection_connection_selection.rb

Overview

show which connection was picked to debug primary/replica slowness when both servers are the same

Defined Under Namespace

Modules: ActualMigrationExtension, AssociationCollectionConnectionSelection, ConfigurationParser, ConnectionSwitcher, DefaultReplicaPatches, MigrationClassExtension, Model, SchemaDumperExtension, SqlComments, Tasks Classes: ShardSelection, ShardSupport

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.disable_replica_readonly_recordsObject

Returns the value of attribute disable_replica_readonly_records.



16
17
18
# File 'lib/active_record_shards.rb', line 16

def disable_replica_readonly_records
  @disable_replica_readonly_records
end

Class Method Details

.app_envObject



19
20
21
22
23
24
25
26
# File 'lib/active_record_shards.rb', line 19

def self.app_env
  env = Rails.env if defined?(Rails.env)
  env ||= RAILS_ENV if Object.const_defined?(:RAILS_ENV)
  env ||= ENV['RAILS_ENV']
  env ||= APP_ENV if Object.const_defined?(:APP_ENV)
  env ||= ENV['APP_ENV']
  env || 'development'
end