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.2.0'
Class Method Summary collapse
Class Method Details
.cache(cache_provider = nil) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/active_remote/cached.rb', line 23 def self.cache(cache_provider = nil) if cache_provider nested_caching = @cache_provider&.nested_caching? @cache_provider = ::ActiveRemote::Cached::Cache.new(cache_provider) # A new Cache starts with nested caching off, so carry the setting over. @cache_provider.enable_nested_caching! if nested_caching end @cache_provider end |
.default_options(options = nil) ⇒ Object
34 35 36 37 38 |
# File 'lib/active_remote/cached.rb', line 34 def self.( = nil) @default_options = if @default_options || {} end |