Sha256: 04034eb2f16e5e4316c2cb969317ca95434660b91060b2df46425a5fc08988b7
Contents?: true
Size: 701 Bytes
Versions: 40
Compression:
Stored size: 701 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!( 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
40 entries across 40 versions & 1 rubygems