josevalim/active_model_serializers — Issue #4: Changing Association Names
Author: Adman65
Created: 2011-12-05 11:18:16+00:00
State: open

Let's say that you have two association for the same object. One is for internal use only and the other is public. It doesn't make sense to return the 'public_association' in the serializable hash. There should be some way to change the association name and still have the id/object concept.

You could do something like this:

```ruby
class RecordSerializer < ActiveModel::Serializer
has_many :public_things, :as => :things, :serializer => ThingSerializer
end
```

I will gladly write the code for this as well since I need this functionality for my app!