Skip to content

Instantly share code, notes, and snippets.

@maxplomer
Created June 13, 2015 03:09
Show Gist options
  • Save maxplomer/45b96f3ed67cd8a53dbd to your computer and use it in GitHub Desktop.
Save maxplomer/45b96f3ed67cd8a53dbd to your computer and use it in GitHub Desktop.
script for bitchart.co to move trades forward and delete old quotes, until improve algorithm
Trade.all.each do |trade|
trade.created_at += 175.days
trade.save
end
quotes = Quote.all
quotes.each do |quote|
if (Time.now - quote.created_at) / 60 / 60 / 24 > 100.days
quote.destroy
end
end
1700001.upto(1770820) do |i|
begin
Quote.find(i).destroy
rescue
puts i
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment