Created
May 1, 2014 19:43
-
-
Save benmullin333/53c008869e64ac805484 to your computer and use it in GitHub Desktop.
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
CSV.foreach("/home/deploy/all_failed_association_tries.csv") do |row| | |
request = JSON.try(:parse, row.first).inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} | |
product = Product.all.detect{ |p| p.game_id == request[:game_id].to_i && p.client_id == request[:client_id].to_i} | |
user = User.find_by_id(request[:user_id].to_i) | |
Ztrack.with_info(:request_product => product, :request_user => user) { Ztrack.associate(request) } unless user && product | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment