Module: Switchman

Defined in:
lib/switchman.rb,
lib/switchman/arel.rb,
lib/switchman/engine.rb,
lib/switchman/errors.rb,
lib/switchman/version.rb,
lib/switchman/shackles.rb,
lib/switchman/call_super.rb,
lib/switchman/environment.rb,
lib/switchman/test_helper.rb,
lib/switchman/schema_cache.rb,
lib/switchman/default_shard.rb,
lib/switchman/r_spec_helper.rb,
lib/switchman/standard_error.rb,
lib/switchman/database_server.rb,
lib/switchman/shackles/relation.rb,
lib/switchman/active_record/base.rb,
lib/switchman/active_support/cache.rb,
lib/switchman/sharded_instrumenter.rb,
app/models/switchman/shard_internal.rb,
lib/switchman/active_record/batches.rb,
lib/switchman/connection_pool_proxy.rb,
lib/switchman/active_record/relation.rb,
lib/switchman/active_record/migration.rb,
lib/switchman/active_record/reflection.rb,
lib/switchman/action_controller/caching.rb,
lib/switchman/active_record/association.rb,
lib/switchman/active_record/persistence.rb,
lib/switchman/active_record/query_cache.rb,
lib/switchman/active_record/type_caster.rb,
lib/switchman/active_record/calculations.rb,
lib/switchman/active_record/model_schema.rb,
lib/switchman/active_record/query_methods.rb,
lib/switchman/active_record/spawn_methods.rb,
lib/switchman/active_record/finder_methods.rb,
lib/switchman/active_record/log_subscriber.rb,
lib/switchman/active_record/connection_pool.rb,
lib/switchman/active_record/statement_cache.rb,
lib/switchman/active_record/abstract_adapter.rb,
lib/switchman/active_record/table_definition.rb,
lib/switchman/active_record/attribute_methods.rb,
lib/switchman/active_record/predicate_builder.rb,
lib/switchman/active_record/connection_handler.rb,
lib/switchman/active_record/postgresql_adapter.rb,
lib/switchman/active_record/where_clause_factory.rb

Defined Under Namespace

Modules: ActionController, ActiveRecord, ActiveSupport, Arel, CallSuper, ConnectionError, RSpecHelper, Rails, Shackles, StandardError, TestHelper Classes: ConnectionPoolProxy, DatabaseServer, DefaultShard, Engine, Environment, NonExistentShardError, ParallelShardExecError, SchemaCache, Shard, ShardedInstrumenter

Constant Summary collapse

VERSION =
"1.14.7"

Class Method Summary collapse

Class Method Details

.cacheObject



11
12
13
# File 'lib/switchman.rb', line 11

def self.cache
  (@cache.respond_to?(:call) ? @cache.call : @cache) || ::Rails.cache
end

.cache=(cache) ⇒ Object



15
16
17
# File 'lib/switchman.rb', line 15

def self.cache=(cache)
  @cache = cache
end

.configObject



6
7
8
9
# File 'lib/switchman.rb', line 6

def self.config
  # TODO: load from yaml
  @config ||= {}
end