Created
November 12, 2012 05:11
-
-
Save rubyonrailsworks/4057624 to your computer and use it in GitHub Desktop.
TaobaoOrder
This file contains hidden or 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
| # -*- encoding : utf-8 -*- | |
| require "csv" | |
| task :check_missing_tids => :environment do | |
| missing_tids=[] | |
| open("lib/data/ExportOrderList201211121238.csv").readlines.each do |line| | |
| row = line.split(",") | |
| tid = row[0].strip | |
| order = TaobaoOrder.find_by_tid(tid) | |
| unless order.present? | |
| unless TaobaoOrder.find_by_tid tid | |
| missing_tids << tid | |
| puts "missing #{tid}" | |
| end | |
| end | |
| puts missing_tids | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment