Created
June 13, 2015 03:09
-
-
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
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
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