Sha256: 202ecbca67e85bb42655fd81a9125e92c3b5ab6f8403ec902f2588a372dc03b4

Contents?: true

Size: 370 Bytes

Versions: 5

Compression:

Stored size: 370 Bytes

Contents

class AddOrganizationCustomReference < ActiveRecord::Migration[5.0]
  def change
    add_column :decidim_organizations, :reference_prefix, :string

    Decidim::Organization.find_each do |organization|
      organization.update_attribute(:reference_prefix, organization.name[0])
    end

    change_column_null :decidim_organizations, :reference_prefix, false
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-core-0.2.0 db/migrate/20170215115407_add_organization_custom_reference.rb
decidim-core-0.1.0 db/migrate/20170215115407_add_organization_custom_reference.rb
decidim-core-0.0.8.1 db/migrate/20170215115407_add_organization_custom_reference.rb
decidim-core-0.0.7 db/migrate/20170215115407_add_organization_custom_reference.rb
decidim-core-0.0.6 db/migrate/20170215115407_add_organization_custom_reference.rb