Module: ActiveRemote::Cached

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_remote/cached.rb,
lib/active_remote/cached/cache.rb,
lib/active_remote/cached/railtie.rb,
lib/active_remote/cached/version.rb,
lib/active_remote/cached/argument_keys.rb

Defined Under Namespace

Modules: ClassMethods Classes: ArgumentKeys, Cache, Railtie

Constant Summary collapse

RUBY_AND_ACTIVE_SUPPORT_VERSION =

When upgrading Rails versions, don’t reuse the same cache key, because you can’t rely upon the serialized objects to be consistent across versions. To fix, this adds a cache key that caches the ruby engine version and the activesupport version to prevent cache re-use across different versions.

"#{RUBY_ENGINE_VERSION}:#{ActiveSupport::VERSION::STRING}".freeze
VERSION =
'1.1.1'

Class Method Summary collapse

Class Method Details

.cache(cache_provider = nil) ⇒ Object



21
22
23
24
25
# File 'lib/active_remote/cached.rb', line 21

def self.cache(cache_provider = nil)
  @cache_provider = ::ActiveRemote::Cached::Cache.new(cache_provider) if cache_provider

  @cache_provider
end

.default_options(options = nil) ⇒ Object



27
28
29
30
31
# File 'lib/active_remote/cached.rb', line 27

def self.default_options(options = nil)
  @default_options = options if options

  @default_options || {}
end