Skip to content

Instantly share code, notes, and snippets.

@afeld
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afeld/10956755 to your computer and use it in GitHub Desktop.
Save afeld/10956755 to your computer and use it in GitHub Desktop.
require 'date'
require 'rubygems'
require 'shopify_api'
ShopifyAPI::Base.site = '...'
@order = ShopifyAPI::Order.new
@order.line_items = [{
:quantity => 1,
:product_id => 222,
:variant_id => 333
}]
@trial_count = 1
def trial(note)
puts "trial #{@trial_count}"
puts " before:"
puts " #{note.inspect}"
@order.note = note
@order.save!
@order.reload
puts " after:"
puts " #{@order.note.inspect}"
@trial_count += 1
end
trial "#{Date.today}\nfoo"
trial "#{Date.today} \nbar"
trial "#{Date.today}baz"
trial "#{Date.today} qux"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment