Sha256: 1d668fe49e886f21995d6d5dea1c7639ebda49bba274561485d3fc4934962ecf
Contents?: true
Size: 702 Bytes
Versions: 50
Compression:
Stored size: 702 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.keys.each do |locale| desc[locale] = step.short_description[locale] + step.description[locale] end desc end end
Version data entries
50 entries across 50 versions & 1 rubygems