Skip to content

Instantly share code, notes, and snippets.

@jhsu
Created September 19, 2012 00:39
Show Gist options
  • Save jhsu/3746953 to your computer and use it in GitHub Desktop.
Save jhsu/3746953 to your computer and use it in GitHub Desktop.
code samples for blog post
thing = ThingDecorator.decorate(Thing.where(:name => "name"))
thing.first.class #=> Thing # undecorated instance
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