diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58c9be30..b789b32f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,51 +8,23 @@ jobs: fail-fast: false matrix: ruby: - - 2.4 - - 2.5 - - 2.6 - 2.7 - 3.0 - 3.1 - 3.2 - 3.3 rails: - - 5.2.0 - 6.0.0 - 6.1.0 - 7.0.1 - 7.1.2 exclude: # These Rails versions are too new for the respective Ruby versions, or vice-versa - - ruby: 2.4 - rails: 6.0.0 - - ruby: 2.4 - rails: 6.1.0 - - ruby: 2.4 - rails: 7.0.1 - - ruby: 2.4 - rails: 7.1.2 - - ruby: 2.5 - rails: 7.0.1 - - ruby: 2.5 - rails: 7.1.2 - - ruby: 2.6 - rails: 7.0.1 - - ruby: 2.6 - rails: 7.1.2 - - ruby: 3.0 - rails: 5.2.0 - ruby: 3.0 rails: 6.0.0 - - ruby: 3.1 - rails: 5.2.0 - ruby: 3.1 rails: 6.0.0 - - ruby: 3.2 - rails: 5.2.0 - ruby: 3.2 rails: 6.0.0 - - ruby: 3.3 - rails: 5.2.0 - ruby: 3.3 rails: 6.0.0 env: diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b8eecb..e4cd4706 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ Please follow the format in [Keep a Changelog](http://keepachangelog.com/) ## [Unreleased] +- Drop support for older than the latest EOL Ruby (2.7) and Rails (6.0) + ## [6.6.0] - 2024-01-02 - Fix support for Rails 6.0 and ForAlter `remove_index` . diff --git a/README.md b/README.md index 5a35b946..fcf16656 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ Departure gem is enabled by default. In order to disable it on a particular migration the method `disable_departure!` should be used. ```ruby -class UseDepartureMigration < ActiveRecord::Migration[5.2] +class UseDepartureMigration < ActiveRecord::Migration[7.1] disable_departure! def up @@ -170,7 +170,7 @@ If you wish to only have Departure enabled per-migration, set `config.enabled_by Then, add a `uses_departure!` statement in migrations where Departure should be used: ```ruby -class UseDepartureMigration < ActiveRecord::Migration[5.2] +class UseDepartureMigration < ActiveRecord::Migration[7.1] uses_departure! def up diff --git a/departure.gemspec b/departure.gemspec index 3d2a4d8a..01bada75 100644 --- a/departure.gemspec +++ b/departure.gemspec @@ -7,7 +7,7 @@ require 'departure/version' # This environment variable is set on CI to facilitate testing with multiple # versions of Rails. -RAILS_DEPENDENCY_VERSION = ENV.fetch('RAILS_VERSION', ['>= 5.2.0', '!= 7.0.0', '< 7.2.0']) +RAILS_DEPENDENCY_VERSION = ENV.fetch('RAILS_VERSION', ['>= 6.0.0', '!= 7.0.0', '< 7.2.0']) Gem::Specification.new do |spec| spec.name = 'departure' @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.4.0' + spec.required_ruby_version = '>= 2.7.0' spec.add_runtime_dependency 'railties', *Array(RAILS_DEPENDENCY_VERSION) spec.add_runtime_dependency 'activerecord', *Array(RAILS_DEPENDENCY_VERSION) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f927dff2..e1c522b1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -59,18 +59,8 @@ Kernel.srand config.seed end -# This shim is for Rails 5.2 compatibility in the test -module Rails5Compatibility - module Migrator - def initialize(direction, migrations, schema_migration_or_target_version = nil, target_version = nil) - if schema_migration_or_target_version == ActiveRecord::SchemaMigration - super(direction, migrations, target_version) - else - super(direction, migrations, schema_migration_or_target_version) - end - end - end - +# This shim is for Rails 7.1 compatibility in the test +module Rails7Compatibility module MigrationContext def initialize(migrations_paths, schema_migration = nil) super(migrations_paths) @@ -78,11 +68,6 @@ def initialize(migrations_paths, schema_migration = nil) end end -if ActiveRecord::VERSION::MAJOR < 6 - ActiveRecord::Migrator.send :prepend, Rails5Compatibility::Migrator - ActiveRecord::MigrationContext.send :prepend, Rails5Compatibility::MigrationContext -end - if ActiveRecord::VERSION::STRING >= '7.1' - ActiveRecord::MigrationContext.send :prepend, Rails5Compatibility::MigrationContext + ActiveRecord::MigrationContext.send :prepend, Rails7Compatibility::MigrationContext end