From 261575eb9478ddf7d0eb5c094b6ac685bc2c1ed1 Mon Sep 17 00:00:00 2001 From: did Date: Tue, 29 May 2012 16:24:28 -0700 Subject: [PATCH] a little bit of cleaning for the upgrade scripts --- script/upgrade_v1.1.rb | 6 +++++- script/upgrade_v1.rb | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/script/upgrade_v1.1.rb b/script/upgrade_v1.1.rb index ec6e0eb7..d36dd15f 100755 --- a/script/upgrade_v1.1.rb +++ b/script/upgrade_v1.1.rb @@ -43,4 +43,8 @@ collection.find.each do |page| locale = get_locale(page['site_id']) collection.update({ '_id' => page['_id'] }, { '$set' => { 'redirect_url' => { locale => page['redirect_url'] } } }) -end \ No newline at end of file +end + +# Update Norwegian locale from 'no' to 'nb' +collection = db.collections.detect { |c| c.name == 'locomotive_accounts' } +collection.update({ 'locale' => 'no' }, { '$set' => { 'locale' => 'nb' }}, { :multi => true }) \ No newline at end of file diff --git a/script/upgrade_v1.rb b/script/upgrade_v1.rb index 7f53fa35..6c19e87b 100755 --- a/script/upgrade_v1.rb +++ b/script/upgrade_v1.rb @@ -358,8 +358,8 @@ if collection = db.collections.detect { |c| c.name == 'pages' } end # Update Norwegian locale from 'no' to 'nb' -if collection = db.collections.detect {|c| c.name == 'locomotive_accounts'} - collection.update({ 'locale' => 'no' }, { '$set' => {'locale' => 'nb'}}, {:multi => true}) +if collection = db.collections.detect { |c| c.name == 'locomotive_accounts' } + collection.update({ 'locale' => 'no' }, { '$set' => { 'locale' => 'nb' } }, { :multi => true }) end # some cleaning