Skip to content

Instantly share code, notes, and snippets.

@ysv
Created August 22, 2018 12:51
Show Gist options
  • Save ysv/ad5bc1ddd8a12871a2a932f756723862 to your computer and use it in GitHub Desktop.
Save ysv/ad5bc1ddd8a12871a2a932f756723862 to your computer and use it in GitHub Desktop.
new_precision = 8
markets=[]
Market.find_each do |m|
markets << m.as_json.slice("bid_unit", "ask_unit", "bid_fee", "ask_fee", "enabled", "position")
m.delete
end
markets.each do |m|
Market.create!(m.merge(ask_precision: new_precision, bid_precision: new_precision))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment