Sha256: 8afb50304d834bf9b0805c171fb6697cbb8a6853b88d8b38a62fe9e2f3792d22
Contents?: true
Size: 712 Bytes
Versions: 14
Compression:
Stored size: 712 Bytes
Contents
# frozen_string_literal: true class RemoveStepsShortDescription < ActiveRecord::Migration[5.0] class ParticipatoryProcessStep < ApplicationRecord self.table_name = :decidim_participatory_process_steps end def change ParticipatoryProcessStep.transaction do ParticipatoryProcessStep.find_each do |step| step.update_attributes!( description: new_description_for(step) ) end remove_column :decidim_participatory_process_steps, :short_description end end def new_description_for(step) desc = {} step.description.each_key do |locale| desc[locale] = step.short_description[locale] + step.description[locale] end desc end end
Version data entries
14 entries across 14 versions & 1 rubygems