Skip to content

Instantly share code, notes, and snippets.

@airspeed
Last active November 17, 2015 16:10
Show Gist options
  • Save airspeed/1dd9ad74e40b3c4f5c88 to your computer and use it in GitHub Desktop.
Save airspeed/1dd9ad74e40b3c4f5c88 to your computer and use it in GitHub Desktop.
( 1 .. 20 ).each do | i |
Voucher.create :code => "WoodBoard#{i}", :quantity => 151, :value => 10, :discount_type => 'NUMBER', :valid_from => Date.today, :valid_until => Date.
parse('2016-01-31'), :shipping_discount => false, :settings => { :products_limit => [ "clxkp002" ] }
Voucher.last.tap{ | g | g.settings = { :products_limit => ["CLXKP002"] } }.save
end
( 1 .. 15 ).each do | i |
Voucher.create :code => "wood#{i}", :quantity => 500, :value => 25, :discount_type => 'PERCENT', :valid_from => Date.today, :valid_until => Date.
parse('2015-12-31'), :shipping_discount => false, :settings => { :products_limit => [ "all" ] }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment