Sha256: aad38d314af166cecd7f8cca8c35a5433e4d2c240a980f608c6b53d73c18c62f
Contents?: true
Size: 462 Bytes
Versions: 52
Compression:
Stored size: 462 Bytes
Contents
# frozen_string_literal: true class FixAnsweredProposalsAfterCopy < ActiveRecord::Migration[5.2] def change proposals_after_copy = Decidim::ResourceLink.where(from_type: "Decidim::Proposals::Proposal").pluck(:from_id) result = Decidim::Proposals::Proposal.where.not(state_published_at: nil).where(state: nil, id: proposals_after_copy) result.find_each do |proposal| proposal.state_published_at = nil proposal.save! end end end
Version data entries
52 entries across 52 versions & 1 rubygems