rails-api/active_model_serializers — pull request #452 by plexus (2013-11-11 14:37:30+00:00)
Title: Using a HasOne association twice raises an exception

When an `Association` detects that it is serializing an array, it calls `use_array_serializer!` to set the serializer to `ArraySerializer`, and set `@options[:each_serializer]` to the current serializer.

When `use_array_serializer!` is called a second time, `:each_serializer` is now `ArraySerializer` which causes things to blow up.

The `HasMany` association already contained a check to prevent calling `use_array_serializer!` twice, this PR adds a similar check to `HasOne`.