rails/rails — pull request #7858 by cliochris (2012-10-05 21:22:17+00:00)
Title: When serialising a class, specify the type of any singular associations,...

When serialising a class, specify the type of any singular associations, if necessary. Rails already correctly specifies the :type of any enumerable association (e.g. a has_many association), but made no attempt to do so for non-enumerables (e.g. a has_one association).

We must specify the :type of any polymorphic association. A has_one association to a class which uses single-table inheritance is an example of a polymorphic association.

Fixes #7471