Skip to content

Instantly share code, notes, and snippets.

@dinedal
Created February 17, 2012 19:33
Show Gist options
  • Select an option

  • Save dinedal/1855043 to your computer and use it in GitHub Desktop.

Select an option

Save dinedal/1855043 to your computer and use it in GitHub Desktop.
Chronicle Migration Script
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