Created
September 19, 2012 00:39
-
-
Save jhsu/3746953 to your computer and use it in GitHub Desktop.
code samples for blog post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thing = ThingDecorator.decorate(Thing.where(:name => "name")) | |
thing.first.class #=> Thing # undecorated instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
items = ItemDecorator.decorate(thing.items) | |
items.wanted.class #=> ActiveRecord::Relation # collection of items wanted, undecorated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment