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.20.1 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.20.0 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.19.1 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.18.1 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.19.0 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.17.2 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.18.0 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.17.1 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.16.1 db/migrate/20190215093700_reset_negative_children_count_counters.rb
decidim-assemblies-0.17.0 db/migrate/20190215093700_reset_negative_children_count_counters.rb