mirror of
https://github.com/redmine/redmine.git
synced 2025-11-18 03:00:52 +01:00
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
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
|
||||
|
||||
ruby '>= 3.0.0', '< 3.4.0'
|
||||
|
||||
gem 'rails', '7.1.2'
|
||||
gem 'rails', '7.2.0'
|
||||
gem 'rouge', '~> 4.2'
|
||||
gem 'mini_mime', '~> 1.1.0'
|
||||
gem "actionpack-xml_parser"
|
||||
|
||||
@@ -78,7 +78,7 @@ class AdminController < ApplicationController
|
||||
@checklist = [
|
||||
[:text_default_administrator_account_changed, User.default_admin_account_changed?],
|
||||
[:text_file_repository_writable, File.writable?(Attachment.storage_path)],
|
||||
[:text_all_migrations_have_been_run, !ActiveRecord::Base.connection.migration_context.needs_migration?],
|
||||
[:text_all_migrations_have_been_run, !ActiveRecord::Base.connection.pool.migration_context.needs_migration?],
|
||||
[:text_minimagick_available, Object.const_defined?(:MiniMagick)],
|
||||
[:text_convert_available, Redmine::Thumbnail.convert_available?],
|
||||
[:text_gs_available, Redmine::Thumbnail.gs_available?]
|
||||
|
||||
@@ -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!}
|
||||
|
||||
@@ -234,7 +234,7 @@ class Redmine::PluginTest < ActiveSupport::TestCase
|
||||
migration_dir = File.join(@klass.directory, 'db', 'migrate')
|
||||
|
||||
Redmine::Plugin::Migrator.current_plugin = plugin
|
||||
context = Redmine::Plugin::MigrationContext.new(migration_dir, ::ActiveRecord::Base.connection.schema_migration)
|
||||
context = Redmine::Plugin::MigrationContext.new(migration_dir, ::ActiveRecord::Base.connection.pool.schema_migration)
|
||||
# current_version should be zero because Foo plugin has no migration
|
||||
assert_equal 0, context.current_version
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user