From 669220530dd07da06812a2a78588683e472d1958 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Thu, 13 Sep 2012 18:50:46 +0800 Subject: [PATCH] add data_migration for rename field for attribute_field. not yet tested --- lib/tasks/data_migration.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/data_migration.rake b/lib/tasks/data_migration.rake index 624cf39c..9c93c18a 100644 --- a/lib/tasks/data_migration.rake +++ b/lib/tasks/data_migration.rake @@ -96,4 +96,8 @@ namespace :data_migration do app.save! end + task :rename_attribute_field => :environment do + AttributeField.collection.update({},{'$rename' => {'title' => 'locale_title'}}, multi: true, safe: true) + end + end \ No newline at end of file