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.20.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.20.0 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.19.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.18.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.19.0 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.17.2 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.18.0 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.17.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.16.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.17.0 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.16.0 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.15.2 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.15.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.15.0 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.14.4 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.14.3 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.14.2 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.14.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.13.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.12.2 db/migrate/20170313095436_add_available_authorizations_to_organization.rb