Module: Switchman::Rails::ClassMethods

Defined in:
lib/switchman/rails.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(klass) ⇒ Object



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

def self.prepended(klass)
  # we want to make sure no one tries to assign to Rails.cache,
  # because it would be wrong w.r.t. sharding.
  klass.send(:remove_method, :cache=)
end

Instance Method Details

#cacheObject



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

def cache
  Switchman::Shard.current.database_server.cache_store
end