drapergem/draper — pull request #530 by haines (2013-04-20 18:46:36+00:00)
Title: Fix decoration of unsaved collection associations

The changes to support STI introduced in #494 also introduced a bug... calling `#decorate` on an unsaved collection association forces a db lookup, clearing any items that have been added to the collection (e.g. using `#build`).

This fixes the problem by decorating the collection directly. It's not super pretty (because it basically copies code from `Decoratable.decorate`) but I will refactor it at some point in the future - for now I just want to unbreak it :)

Closes #518.