Sha256: 71c7ef29ccac5b8064a91664a6facf90861445675a8479a547776484c2e63c23
Contents?: true
Size: 533 Bytes
Versions: 6
Compression:
Stored size: 533 Bytes
Contents
# frozen_string_literal: true namespace :decidim_initiatives do namespace :upgrade do desc "Fixes the broken pages" task fix_broken_pages: :environment do Decidim::Initiative.find_each do |initiative| initiative.components.where(manifest_name: "pages").each do |component| next unless Decidim::Pages::Page.where(component:).empty? Decidim::Pages::CreatePage.call(component) do on(:invalid) { raise "Cannot create page" } end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems