Sha256: ee361a3f67c81974b686996cd23b82f79776420862b1d6a205f4fb05bb3068fb
Contents?: true
Size: 578 Bytes
Versions: 46
Compression:
Stored size: 578 Bytes
Contents
# frozen_string_literal: true class FixCountersForCopiedProposals < ActiveRecord::Migration[5.2] def up copies_ids = Decidim::ResourceLink .where( name: "copied_from_component", from_type: "Decidim::Proposals::Proposal", to_type: "Decidim::Proposals::Proposal" ).pluck(:to_id) Decidim::Proposals::Proposal.where(id: copies_ids).find_each do |record| record.class.reset_counters(record.id, :follows) record.update_comments_count end end def down; end end
Version data entries
46 entries across 46 versions & 1 rubygems