From: Go MAEDA Date: Thu, 1 Apr 2021 15:02:47 +0000 (+0000) Subject: Fix "ArgumentError: wrong number of arguments (given 1, expected 2) on Redmine::Plugi... X-Git-Tag: 5.0.0~471 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f223f707da62dce350f760fa04f870fd9ce0274a;p=redmine.git Fix "ArgumentError: wrong number of arguments (given 1, expected 2) on Redmine::PluginTest#test_migrate_redmine_plugin" (#29914, #32939). Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@20888 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 0f20a1993..48d04dcac 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -539,7 +539,7 @@ module Redmine else migrations end - Migrator.new(:up, selected_migrations, target_version).migrate + Migrator.new(:up, selected_migrations, schema_migration, target_version).migrate end def down(target_version = nil) @@ -549,15 +549,15 @@ module Redmine else migrations end - Migrator.new(:down, selected_migrations, target_version).migrate + Migrator.new(:down, selected_migrations, schema_migration, target_version).migrate end def run(direction, target_version) - Migrator.new(direction, migrations, target_version).run + Migrator.new(direction, migrations, schema_migration, target_version).run end def open - Migrator.new(:up, migrations, nil) + Migrator.new(:up, migrations, schema_migration) end end @@ -571,7 +571,7 @@ module Redmine self.current_plugin = plugin return if current_version(plugin) == version - MigrationContext.new(plugin.migration_directory).migrate(version) + MigrationContext.new(plugin.migration_directory, ::ActiveRecord::Base.connection.schema_migration).migrate(version) end def get_all_versions(plugin = current_plugin)