Sha256: f6054be068240ec85b600cd578c376522e5c3283373e6cd91f353d3dedf73b90

Contents?: true

Size: 492 Bytes

Versions: 88

Compression:

Stored size: 492 Bytes

Contents

# frozen_string_literal: true

class FixNilThresholdPerProposal < ActiveRecord::Migration[5.1]
  class Component < ApplicationRecord
    self.table_name = :decidim_components
  end

  def change
    proposal_components = Component.where(manifest_name: "proposals")

    proposal_components.each do |component|
      settings = component.attributes["settings"]
      settings["global"]["threshold_per_proposal"] ||= 0
      component.settings = settings
      component.save
    end
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

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