drapergem/draper — pull request #394 by haines (2012-12-19 22:01:20+00:00)
Title: Simplify decorator inferral

I removed the `with: :infer` option from collection decorators, and tidied up `DecoratedAssociation` correspondingly. If `:with` is not supplied, the item decorator is inferred from the collection decorator (`ProductsDecorator => ProductDecorator`). If that fails, then `decorate` is called on each individual item when decorating the collection.

This fixes an issue reported [here](https://github.com/drapergem/draper/pull/388#issuecomment-11356659) and [here](https://github.com/drapergem/draper/issues/393#issuecomment-11535339).

I also removed the possibility of changing the decorator's source after instantiation. For collection decorators this wouldn't have worked at all due to the caching, and for singular decorators I think it's probably a bad idea (although it would have worked).