Sha256: 87e0826954e9bb8996743cf7ff4a7414e9a7a11c941139d5789ddf604d939ca3
Contents?: true
Size: 486 Bytes
Versions: 14
Compression:
Stored size: 486 Bytes
Contents
# frozen_string_literal: true class AddOrganizationCustomReference < ActiveRecord::Migration[5.0] class Organization < ApplicationRecord self.table_name = :decidim_organizations end def change add_column :decidim_organizations, :reference_prefix, :string Organization.find_each do |organization| organization.update_attributes!(reference_prefix: organization.name[0]) end change_column_null :decidim_organizations, :reference_prefix, false end end
Version data entries
14 entries across 14 versions & 1 rubygems