class TaskSerializer include JSONAPI::Serializer attributes :name, :description, :user_id, :activity_id # has_many :records cache_options store: Rails.cache, namespace: 'jsonapi-serializer', expires_in: 1.hour end