drapergem/draper — pull request #572 by danfinnie (2013-08-30 03:33:11+00:00)
Title: Collection decorator readers

The Decorator class allows subclasses to reference the object being decorated with #object, #source, #model, or #to_source. I happened to be familiar with #model and was surprised when this wasn't available in a CollectionDecorator. This PR adds the same aliases to CollectionDecorator that Decorator has.

It was kind of funky to test because these are protected methods, so in the test I created subclasses of CollectionDecorator that used the protected method. They could also just use send if you'd prefer that.

@ckundo Check it out :)