rails-api/active_model_serializers — pull request #394 by ungue (2013-10-06 15:45:18+00:00)
Title: Allows additional cache options

This pull request allows to pass additional options when cache fetching. You only have to add cache_options method in your serializer to be able to add parameters as expires_in, race_condition_ttl, ...

```ruby
class ProgrammerSerializer < ActiveModel::Serializer
cached true
attributes :name, :skills

def self.to_s
'serializer'
end

def cache_key
object.name
end

def cache_options
{ race_condition_ttl: 10, expires_in: 1.minute }
end
end
```