Feature #36320 » 0001-Upgrade-to-Rails-7.2.0.patch
| Gemfile | ||
|---|---|---|
|
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"
|
||
| app/controllers/admin_controller.rb | ||
|---|---|---|
|
@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?]
|
||
| lib/redmine/plugin.rb | ||
|---|---|---|
|
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!}
|
||
| test/unit/lib/redmine/plugin_test.rb | ||
|---|---|---|
|
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
|
||