Created
December 28, 2011 17:33
-
-
Save tommetge/1528806 to your computer and use it in GitHub Desktop.
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
| #!/usr/env/ruby | |
| # read user ids in from CSV path | |
| # path is the first argument in calling the script | |
| sis_user_ids = File.readlines(ARGV[0]).map {|l| l.strip.split(",")} | |
| sis_user_ids.each do |user_id, new_user_id| | |
| ps = Pseudonym.find(:first, :conditions => "account_id = 81788 and sis_user_id = '#{user_id}'") rescue nil | |
| if ps | |
| ps.sis_user_id = new_user_id | |
| ps.save | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment