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:
@@ -441,17 +441,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def perform_caching?
|
||||
perform_caching && cache && cache_key
|
||||
end
|
||||
|
||||
# Override this method if you want to create a key based on associations
|
||||
# Here's an example: your serializer has associations and the scope
|
||||
#
|
||||
# def cache_key
|
||||
# [ object, scope, scope.comments ]
|
||||
# end
|
||||
def cache_key
|
||||
object.try :cache_key
|
||||
perform_caching && cache && try(:cache_key)
|
||||
end
|
||||
|
||||
def expand_cache_key(*args)
|
||||
|
||||
Reference in New Issue
Block a user