From fb37d2e4fab887d0abed786541d09eaec0838317 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Tue, 20 Aug 2024 05:54:30 +0000 Subject: Upgrade to Rails 7.2.0 (#36320). Patch by Takashi Kato (user:tohosaku). git-svn-id: https://svn.redmine.org/redmine/trunk@22960 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 7ea6bfada..f341d30e1 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -526,14 +526,14 @@ module Redmine self.current_plugin = plugin return if current_version(plugin) == version - MigrationContext.new(plugin.migration_directory, ::ActiveRecord::Base.connection.schema_migration).migrate(version) + MigrationContext.new(plugin.migration_directory, ::ActiveRecord::Base.connection.pool.schema_migration).migrate(version) end def get_all_versions(plugin = current_plugin) # Delete migrations that don't match .. to_i will work because the number comes first @all_versions ||= {} @all_versions[plugin.id.to_s] ||= begin - sm_table = ::ActiveRecord::Base.connection.schema_migration.table_name + sm_table = ::ActiveRecord::Base.connection.pool.schema_migration.table_name migration_versions = ActiveRecord::Base.connection.select_values("SELECT version FROM #{sm_table}") versions_by_plugins = migration_versions.group_by {|version| version.match(/-(.*)$/).try(:[], 1)} @all_versions = versions_by_plugins.transform_values! {|versions| versions.map!(&:to_i).sort!} -- cgit v1.2.3