From 98c78f62678754a79ef24cb5e4b3d19947d910a8 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 5 May 2020 11:46:25 -0500 Subject: [PATCH] Put the rename uploader column into a change method --- .../templates/migrate/rename_uploader_columns.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gems/houdini_upgrade/lib/generators/cw_to_activestorage/templates/migrate/rename_uploader_columns.rb b/gems/houdini_upgrade/lib/generators/cw_to_activestorage/templates/migrate/rename_uploader_columns.rb index 672aa8e1..6cd4ad3b 100644 --- a/gems/houdini_upgrade/lib/generators/cw_to_activestorage/templates/migrate/rename_uploader_columns.rb +++ b/gems/houdini_upgrade/lib/generators/cw_to_activestorage/templates/migrate/rename_uploader_columns.rb @@ -1,9 +1,11 @@ # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later class RenameUploaderColumns < ActiveRecord::Migration[5.2] - require "houdini_upgrade" - HoudiniUpgrade::UPLOADERS_TO_MIGRATE.each do |table| - table.fields.each do |field| - rename_column table.name, field.name, field.migrated_name + def change + require "houdini_upgrade" + HoudiniUpgrade::UPLOADERS_TO_MIGRATE.each do |table| + table.fields.each do |field| + rename_column table.name, field.name, field.migrated_name + end end end end \ No newline at end of file