Class: Api::V6::BaseSerializer

Inherits:
Object
  • Object
show all
Includes:
JSONAPI::Serializer
Defined in:
app/serializers/api/v6/base_serializer.rb

Class Method Summary collapse

Class Method Details

.record_cache_options(options, fieldset, include_list, params) ⇒ Object

Override the record_cache_options method to include I18n.locale in the cache key



10
11
12
13
14
15
# File 'app/serializers/api/v6/base_serializer.rb', line 10

def self.record_cache_options(options, fieldset, include_list, params)
  opts = options.dup
  # Add the locale to the cache key
  opts[:namespace] += ":#{MyLocaleManager.normalize_locale}"
  super(opts, fieldset, include_list, params)
end