Module: Workarea::Configuration::CacheStore

Extended by:
CacheStore
Included in:
CacheStore
Defined in:
lib/workarea/configuration/cache_store.rb

Instance Method Summary collapse

Instance Method Details

#loadObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/workarea/configuration/cache_store.rb', line 6

def load
  if Rails.env.test?
    Rails.application.config.cache_store = :null_store
  elsif !Rails.env.development?
    Rails.application.config.cache_store = :redis_cache_store, {
      url: Workarea::Configuration::Redis.cache.to_url
    }

    require 'redis-rack-cache'
    Rails.application.config.action_dispatch.rack_cache = {
      metastore: Workarea::Configuration::Redis.cache.to_url,
      entitystore: Workarea::Configuration::Redis.cache.to_url
    }
  end
end