Skip to content

Commit

Permalink
Add script to update existing data => moderation
Browse files Browse the repository at this point in the history
  • Loading branch information
ludivinecp committed Feb 1, 2018
1 parent 3cda971 commit f6a7ca0
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AddDataForModeration < ActiveRecord::Migration[5.1]
def up
Decidim::Comments::Comment.all.each {|c|Decidim::Moderation.find_or_create_by!(reportable: c, participatory_space: c.feature.participatory_space, upstream_moderation: "authorized")}

Decidim::Proposals::Proposal.all.each {|p|Decidim::Moderation.find_or_create_by!(reportable: p, participatory_space: p.feature.participatory_space, upstream_moderation: "authorized")}

Decidim::Moderation.all.each {|m| m.update_attributes(upstream_moderation: "authorized")}
end

def down; end
end

0 comments on commit f6a7ca0

Please sign in to comment.