diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 69b4fce1..960cfc93 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -48,29 +48,18 @@ Testing is a little awkward because the test suite: 1. Contains a "dummy" rails app with three databases (test, foo, and bar) 1. Supports three different RDBMS': sqlite, mysql, and postgres -### Test sqlite, AR 6 +### Test + +For most development, testing with sqlite only is easiest and sufficient. CI +will run the rest. ``` DB=sqlite bundle exec appraisal rails-6.0 rake -``` - -### Test sqlite, AR 5 - -``` -DB=sqlite bundle exec appraisal rails-5.2 rake -``` - -### Test mysql, AR 5 - -``` -DB=mysql bundle exec appraisal rails-5.2 rake -``` - -### Test postgres, AR 5 - -``` +DB=sqlite bundle exec appraisal rails-6.1 rake +DB=sqlite bundle exec appraisal rails-7.0 rake +DB=mysql bundle exec appraisal rails-7.0 rake createuser --superuser postgres -DB=postgres bundle exec appraisal rails-5.2 rake +DB=postgres bundle exec appraisal rails-7.0 rake ``` ## The dummy_app @@ -80,7 +69,7 @@ In the rare event you need a `console` in the `dummy_app`: ``` cd spec/dummy_app cp config/database.mysql.yml config/database.yml -BUNDLE_GEMFILE='../../gemfiles/rails_5.2.gemfile' bin/rails console -e test +BUNDLE_GEMFILE='../../gemfiles/rails_7.0.gemfile' bin/rails console -e test ``` ## Adding new schema diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c5c95225..e0c604ad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,7 @@ jobs: # have set this up with each database as a separate job, but then we'd be # duplicating the matrix configuration three times. matrix: - gemfile: [ 'rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0' ] + gemfile: [ 'rails_6.0', 'rails_6.1', 'rails_7.0' ] # To keep matrix size down, only test highest and lowest rubies. # Ruby 3.0 is an exception. For now, let's continue to test against 2.7 @@ -69,12 +69,6 @@ jobs: ruby: [ '2.6', '2.7', '3.0', '3.1' ] exclude: - # rails 5.2 requires ruby < 3.0 - # https://github.com/rails/rails/issues/40938 - - ruby: '3.0' - gemfile: 'rails_5.2' - - ruby: '3.1' - gemfile: 'rails_5.2' # rails 7 requires ruby > 2.7 - ruby: '2.6' gemfile: 'rails_7.0' diff --git a/Appraisals b/Appraisals index b3771915..13a6df13 100644 --- a/Appraisals +++ b/Appraisals @@ -8,12 +8,6 @@ # > appraisal. If something is specified in both the Gemfile and an appraisal, # > the version from the appraisal takes precedence. # > https://github.com/thoughtbot/appraisal -# -# -appraise "rails-5.2" do - gem "rails", "~> 5.2.4" - gem "rails-controller-testing", "~> 1.0.2" -end appraise "rails-6.0" do gem "rails", "~> 6.0.3" diff --git a/CHANGELOG.md b/CHANGELOG.md index d72f0c0c..0ffc1f4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,11 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/). ### Breaking Changes -- None +- None, but see Dependencies below + +### Dependencies + +- Drop support for Rails 5.2, which reached EoL on 2022-06-01 ### Added diff --git a/README.md b/README.md index b9ea7866..b465f24f 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Choose version: | paper_trail | branch | ruby | activerecord | |-------------|------------|----------|---------------| -| unreleased | master | >= 2.6.0 | >= 5.2, < 7.1 | +| unreleased | master | >= 2.6.0 | >= 6.0, < 7.1 | | 13 | 13-stable | >= 2.6.0 | >= 5.2, < 7.1 | | 12 | 12-stable | >= 2.6.0 | >= 5.2, < 7.1 | | 11 | 11-stable | >= 2.4.0 | >= 5.2, < 6.1 | diff --git a/gemfiles/rails_5.2.gemfile b/gemfiles/rails_5.2.gemfile deleted file mode 100644 index 4fd4d624..00000000 --- a/gemfiles/rails_5.2.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rails", "~> 5.2.4" -gem "rails-controller-testing", "~> 1.0.2" - -gemspec path: "../" diff --git a/lib/paper_trail/compatibility.rb b/lib/paper_trail/compatibility.rb index 5a5ee0df..a93e6965 100644 --- a/lib/paper_trail/compatibility.rb +++ b/lib/paper_trail/compatibility.rb @@ -17,7 +17,7 @@ module PaperTrail # newer rails versions. Most PT users should avoid incompatible rails # versions. module Compatibility - ACTIVERECORD_GTE = ">= 5.2" # enforced in gemspec + ACTIVERECORD_GTE = ">= 6.0" # enforced in gemspec ACTIVERECORD_LT = "< 7.1" # not enforced in gemspec E_INCOMPATIBLE_AR = <<-EOS diff --git a/spec/dummy_app/config/application.rb b/spec/dummy_app/config/application.rb index 4441c665..bd66b206 100644 --- a/spec/dummy_app/config/application.rb +++ b/spec/dummy_app/config/application.rb @@ -21,13 +21,6 @@ module Dummy config.active_support.test_order = :sorted config.secret_key_base = "A fox regularly kicked the screaming pile of biscuits." - # In rails >= 6.0, "`.represent_boolean_as_integer=` is now always true, - # so setting this is deprecated and will be removed in Rails 6.1." - if ::ENV["DB"] == "sqlite" && - ::Gem::Requirement.new("~> 5.2").satisfied_by?(::Rails.gem_version) - config.active_record.sqlite3.represent_boolean_as_integer = true - end - # `use_yaml_unsafe_load` was added in 7.0.3.1, will be removed in 7.1.0? if ::ActiveRecord.respond_to?(:use_yaml_unsafe_load) ::ActiveRecord.use_yaml_unsafe_load = false diff --git a/spec/support/paper_trail_spec_migrator.rb b/spec/support/paper_trail_spec_migrator.rb index 317dd381..f53903cb 100644 --- a/spec/support/paper_trail_spec_migrator.rb +++ b/spec/support/paper_trail_spec_migrator.rb @@ -18,22 +18,11 @@ class PaperTrailSpecMigrator @migrations_path = dummy_app_migrations_dir end - # Looks like the API for programmatically running migrations will change - # in rails 5.2. This is an undocumented change, AFAICT. Then again, - # how many people use the programmatic interface? Most people probably - # just use rake. Maybe we're doing it wrong. - # - # See also discussion in https://github.com/rails/rails/pull/40806, when - # MigrationContext#migrate became public. def migrate - if ::ActiveRecord.gem_version >= ::Gem::Version.new("6.0.0.rc2") - ::ActiveRecord::MigrationContext.new( - @migrations_path, - ::ActiveRecord::Base.connection.schema_migration - ).migrate - else - ::ActiveRecord::MigrationContext.new(@migrations_path).migrate - end + ::ActiveRecord::MigrationContext.new( + @migrations_path, + ::ActiveRecord::Base.connection.schema_migration + ).migrate end # Generate a migration, run it, and delete it. We use this for testing the