Skip to content

Instantly share code, notes, and snippets.

@arulprasad
Created September 21, 2011 06:23
Show Gist options
  • Save arulprasad/1231394 to your computer and use it in GitHub Desktop.
Save arulprasad/1231394 to your computer and use it in GitHub Desktop.
s = Store.find_by_code('landscape'); inventories = Item.where("id NOT IN (?)", s.inventories.collect(&:item_id)).collect {|i| s.inventories.create!(:item_id => i.id, :quantity => 100) }; inventories.class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment