Last active
August 29, 2015 13:59
-
-
Save afeld/10956755 to your computer and use it in GitHub Desktop.
Shopify note saving bug https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/note-being-modified-187804
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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