From 71a6a2e8e46eb84a76f75b54bea266d40aa5e6be Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 10 Dec 2015 20:19:46 +0100 Subject: Move existing posts to proper locale. This makes sure the existing posts appear after the upgrade. --- db/migrate/20151210191646_move_posts_to_proper_locale.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 db/migrate/20151210191646_move_posts_to_proper_locale.rb (limited to 'db/migrate') diff --git a/db/migrate/20151210191646_move_posts_to_proper_locale.rb b/db/migrate/20151210191646_move_posts_to_proper_locale.rb new file mode 100644 index 0000000..faeaf3c --- /dev/null +++ b/db/migrate/20151210191646_move_posts_to_proper_locale.rb @@ -0,0 +1,9 @@ +class MovePostsToProperLocale < ActiveRecord::Migration + def up + Refinery::Blog::Post::Translation.all.each { |tx| tx.locale = "nb"; tx.save! } + end + + def down + Refinery::Blog::Post::Translation.all.each { |tx| tx.locale = "en"; tx.save! } + end +end -- cgit v1.2.3