rails-api/active_model_serializers — pull request #677 by guilleiguaran (2014-10-10 21:54:14+00:00)
Title: Add support for embed: :ids option for in associations

Hey!!

We would like to add an option to associations to allow the inclusion of only associated object ids instead of full objects, for this I'm proposing the ``embed: :ids`` option, example:

```ruby
class AuthorSerializer < ActiveModel::Serializer
attributes :id, :name

has_many :posts, embed: :ids
end
```

in JSON API adapter this will not include the posts within the ``linked`` hash.

I'm not convinced by the option name, let me know if you have other suggestions.