From 707a3093f6b470f10a71c7cc295e057e4ef31cb5 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Mon, 21 Dec 2015 10:59:15 -0300 Subject: [PATCH] Add a migration to fix proposals categories --- db/migrate/20151221105330_add_categories_proposal.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+), 0 deletions(-) create mode 100644 db/migrate/20151221105330_add_categories_proposal.rb diff --git a/db/migrate/20151221105330_add_categories_proposal.rb b/db/migrate/20151221105330_add_categories_proposal.rb new file mode 100644 index 0000000..0a594e9 --- /dev/null +++ b/db/migrate/20151221105330_add_categories_proposal.rb @@ -0,0 +1,13 @@ +class AddCategoriesProposal < ActiveRecord::Migration + + def self.up + ProposalsDiscussionPlugin::Proposal.find_each do |proposal| + proposal.inherit_parent_categories + end + end + + def self.down + puts "Warning: cannot restore original categories" + end + +end -- libgit2 0.21.2