Skip to content

Instantly share code, notes, and snippets.

@adamgamble
Forked from rclements/gist:7433235
Last active December 28, 2015 03:09
Show Gist options
  • Save adamgamble/7433276 to your computer and use it in GitHub Desktop.
Save adamgamble/7433276 to your computer and use it in GitHub Desktop.
$10 iTunes Gift Card
product = Spree::Product.find 11666
variant = Spree::Variant.where(:product_id => product.id).first
line_items = Spree::LineItem.where(:variant_id => 11622).pluck(&:id)
RewardDelivery.where(:reward_id => line_items)
$5 Claire's Gift Card
product = Spree::Product.find 11689
variant = Spree::Variant.where(:product_id => product.id).first
line_items = LineItem.where(:variant_id => [8495, 8561,8780, 8850])
RewardDelivery.where(:reward_id => line_items)
$5 Justice Gift Card
product = Spree::Product.find 11693
variant = Spree::Variant.where(:product_id => product.id).first
line_items = Spree::LineItem.where(:variant_id => variant.id).pluck(&:id)
RewardDelivery.where(:reward_id => line_items)
$5 Justice Gift Card
product = Spree::Product.find 11692
variant = Spree::Variant.where(:product_id => product.id).first
line_items = Spree::LineItem.where(:variant_id => variant.id).pluck(&:id)
RewardDelivery.where(:reward_id => line_items)
$5 Justice Gift Card
product = Spree::Product.find 11691
variant = Spree::Variant.where(:product_id => product.id).first
line_items = Spree::LineItem.where(:variant_id => variant.id).pluck(&:id)
RewardDelivery.where(:reward_id => line_items)
$5 Dick's Gift Card
product = Spree::Product.find 11690
variant = Spree::Variant.where(:product_id => product.id).first
line_items = Spree::LineItem.where(:variant_id => variant.id).pluck(&:id)
RewardDelivery.where(:reward_id => line_items)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment