Adds caching
This commit is contained in:
parent
ebf68217cd
commit
203c9c6696
2 changed files with 4 additions and 0 deletions
|
|
@ -1,4 +1,6 @@
|
|||
class ActivitySerializer
|
||||
include JSONAPI::Serializer
|
||||
attributes :name, :author_id, :description, :client
|
||||
|
||||
cache_options store: Rails.cache, namespace: 'jsonapi-serializer', expires_in: 1.hour
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,4 +2,6 @@ class UserSerializer
|
|||
include JSONAPI::Serializer
|
||||
attributes :email, :username
|
||||
has_many :activities
|
||||
|
||||
cache_options store: Rails.cache, namespace: 'jsonapi-serializer', expires_in: 1.hour
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue