Sha256: 87d7b6938a94354baeeebfad38b0d548743dc9b8fee2d55c9e0b9610cad4aa25

Contents?: true

Size: 269 Bytes

Versions: 70

Compression:

Stored size: 269 Bytes

Contents

# frozen_string_literal: true

class ResetNegativeChildrenCountCounters < ActiveRecord::Migration[5.2]
  def change
    ids = Decidim::Assembly.where("children_count < 0").pluck(:id)
    ids.each { |id| Decidim::Assembly.reset_counters(id, :children_count) }
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
decidim-assemblies-0.29.1 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.28.4 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.27.9 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.29.0 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.28.3 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.27.8 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.29.0.rc4 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.29.0.rc3 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.29.0.rc2 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.29.0.rc1 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.28.2 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.27.7 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.28.1 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.27.6 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.26.10 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.26.9 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.28.0 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.27.5 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.28.0.rc5 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.28.0.rc4 db/migrate/20190215093700_reset_negative_children_count_counters.rb