Skip to content

Instantly share code, notes, and snippets.

@olvap
Last active December 14, 2015 06:19
Show Gist options
  • Select an option

  • Save olvap/5041480 to your computer and use it in GitHub Desktop.

Select an option

Save olvap/5041480 to your computer and use it in GitHub Desktop.
require 'csv'
accounts = CSV.read('data.csv')
accounts.shift # Get rid of the header
accounts.each do |account|
domain = account[-2].split(' ').first #toma la primera palabra
chargify_id = account[0]
a = Account.search(domain_contains: domain).first
if a
a.chargify_id = chargify_id
a.save
end
end
@olvap
Copy link
Copy Markdown
Author

olvap commented Feb 26, 2013

data.csv es el archivo de exportacion de chargify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment