Created
February 17, 2012 19:33
-
-
Save dinedal/1855043 to your computer and use it in GitHub Desktop.
Chronicle Migration Script
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
| namespace :chronicle do | |
| desc "Rename Store tags in Chronicle after Accounts integration" | |
| task :migrate_for_accounts, [:client_id] => :environment do |t, args| | |
| client = Client.find(args.client_id) | |
| vitrue_id = client.vitrue_id_for_account.to_s | |
| stores = client.stores | |
| stores.find_each do |store| | |
| old_tag = "s:#{store.id}" | |
| new_tag = "s:#{store.vitrue_id_for_resource}" | |
| # ChronicleClient::Tabs::TagRename.rename(old_tag, new_tag, vitrue_id) | |
| ChronicleClient::Tabs::TagRename.rename(old_tag, new_tag, "tabs-#{args.client_id.to_s}") | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment