mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Have to opt in with #cache_key
This commit is contained in:
@@ -30,10 +30,6 @@ class CachingTest < ActiveModel::TestCase
|
||||
%w(ruby)
|
||||
end
|
||||
|
||||
def cache_key
|
||||
name
|
||||
end
|
||||
|
||||
def read_attribute_for_serialization(name)
|
||||
send name
|
||||
end
|
||||
@@ -61,6 +57,10 @@ class CachingTest < ActiveModel::TestCase
|
||||
def self.to_s
|
||||
'serializer'
|
||||
end
|
||||
|
||||
def cache_key
|
||||
object.name
|
||||
end
|
||||
end
|
||||
|
||||
serializer.cache = NullStore.new
|
||||
@@ -82,6 +82,10 @@ class CachingTest < ActiveModel::TestCase
|
||||
def self.to_s
|
||||
'serializer'
|
||||
end
|
||||
|
||||
def cache_key
|
||||
object.name
|
||||
end
|
||||
end
|
||||
|
||||
serializer.cache = NullStore.new
|
||||
|
||||
Reference in New Issue
Block a user