Sha256: e44d0d3cabb765396d1bb4ec0152d65227d806e0583b252e56447a06081cba6a

Contents?: true

Size: 408 Bytes

Versions: 30

Compression:

Stored size: 408 Bytes

Contents

# frozen_string_literal: true

class AddAvailableAuthorizationsToOrganization < ActiveRecord::Migration[5.0]
  def change
    add_column :decidim_organizations, :available_authorizations, :string, array: true, default: []

    handlers = Decidim.authorization_handlers.map(&:name)
    Decidim::Organization.find_each do |org|
      org.update_attributes(available_authorizations: handlers)
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
decidim-core-0.6.8 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.6.8 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.6.7 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.6.7 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.6.6 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.6.6 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.6.5 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.6.5 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.6.4 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.6.4 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.6.3 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.6.3 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.6.2 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.6.2 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.6.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.6.1 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.6.0 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.6.0 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-core-0.5.1 db/migrate/20170313095436_add_available_authorizations_to_organization.rb
decidim-0.5.1 decidim-core/db/migrate/20170313095436_add_available_authorizations_to_organization.rb