Sha256: 77819564fd1ad019b0e6a35aef83f2ae674112345395b09368951d8d7e202d4f

Contents?: true

Size: 486 Bytes

Versions: 90

Compression:

Stored size: 486 Bytes

Contents

# frozen_string_literal: true

class AddAvailableAuthorizationsToOrganization < ActiveRecord::Migration[5.0]
  class Organization < ApplicationRecord
    self.table_name = :decidim_organizations
  end

  def change
    add_column :decidim_organizations, :available_authorizations, :string, array: true, default: []

    workflows = Decidim::Verifications.workflows.map(&:name)
    Organization.find_each do |org|
      org.update!(available_authorizations: workflows)
    end
  end
end

Version data entries

90 entries across 90 versions & 1 rubygems

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