rails-api/active_model_serializers — pull request #679 by RobinDaugherty (2014-10-12 06:54:32+00:00)
Title: Serializer options

Prior to 0.9, `@options` was available within serializers to see the options passed to `to_json`. For some reason, with 0.9 the options are no longer passed and are entirely inaccessible within a Serializer object.

This restores the access to options by placing it in an attribute named `serializer_options`.

An example of using this would be the following in a controller:
```render json: @model_object, short_form: true```

This would allow the following to be done in the serializer:
```serialization_options[:short_form]```
or to specify a default value:
```serialization_options.fetch(:short_form, false)```