diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1a8ba1..f528bd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: - rails_6.1 - rails_7.0 - rails_7.1 + - rails_7.2 name: PostgreSQL ${{ matrix.pg }} - Ruby ${{ matrix.ruby }} - ${{ matrix.gemfile }} runs-on: ubuntu-latest env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps diff --git a/Appraisals b/Appraisals index 9c68039..7a22a8b 100644 --- a/Appraisals +++ b/Appraisals @@ -9,3 +9,7 @@ end appraise "rails-7.1" do gem "rails", "7.1.0" end + +appraise "rails-7.2" do + gem "rails", "7.2.2" +end diff --git a/gemfiles/rails_7.2.gemfile b/gemfiles/rails_7.2.gemfile new file mode 100644 index 0000000..247e05d --- /dev/null +++ b/gemfiles/rails_7.2.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "7.2.2" + +gemspec path: "../" diff --git a/lib/pg_ha_migrations/allowed_versions.rb b/lib/pg_ha_migrations/allowed_versions.rb index 6a75b43..06f194e 100644 --- a/lib/pg_ha_migrations/allowed_versions.rb +++ b/lib/pg_ha_migrations/allowed_versions.rb @@ -1,7 +1,7 @@ require "active_record/migration/compatibility" module PgHaMigrations::AllowedVersions - ALLOWED_VERSIONS = [4.2, 5.0, 5.1, 5.2, 6.0, 6.1, 7.0, 7.1].map do |v| + ALLOWED_VERSIONS = [4.2, 5.0, 5.1, 5.2, 6.0, 6.1, 7.0, 7.1, 7.2].map do |v| begin ActiveRecord::Migration[v] rescue ArgumentError diff --git a/pg_ha_migrations.gemspec b/pg_ha_migrations.gemspec index 847b961..ea3239b 100644 --- a/pg_ha_migrations.gemspec +++ b/pg_ha_migrations.gemspec @@ -32,12 +32,12 @@ Gem::Specification.new do |spec| spec.add_development_dependency "rake", ">= 12.3.3" spec.add_development_dependency "rspec", "~> 3.0" spec.add_development_dependency "pg" - spec.add_development_dependency "db-query-matchers", "~> 0.12.0" + spec.add_development_dependency "db-query-matchers", "~> 0.14" spec.add_development_dependency "pry" spec.add_development_dependency "pry-byebug" spec.add_development_dependency "appraisal", "~> 2.5" - spec.add_dependency "rails", ">= 6.1", "< 7.2" + spec.add_dependency "rails", ">= 6.1", "< 7.3" spec.add_dependency "relation_to_struct", ">= 1.5.1" spec.add_dependency "ruby2_keywords" end diff --git a/spec/safe_statements_spec.rb b/spec/safe_statements_spec.rb index 5d8cb96..172fca7 100644 --- a/spec/safe_statements_spec.rb +++ b/spec/safe_statements_spec.rb @@ -94,6 +94,10 @@ def pool_config PgHaMigrations::AllowedVersions::ALLOWED_VERSIONS.each do |migration_klass| describe migration_klass do + let(:schema_migration) do + ActiveRecord::Base.connection.schema_migration if ActiveRecord::Base.connection.respond_to?(:schema_migration) + end + it "can be used as a migration class" do expect do Class.new(migration_klass) @@ -123,7 +127,7 @@ def up # which completely bypasses this logic. ActiveRecord::MigrationContext.new( migration_dir, - ActiveRecord::Base.connection.schema_migration, + schema_migration, ).migrate end end.to raise_error(StandardError, /An error has occurred, all later migrations canceled/) @@ -160,7 +164,7 @@ def up # which completely bypasses this logic. ActiveRecord::MigrationContext.new( migration_dir, - ActiveRecord::Base.connection.schema_migration, + schema_migration, ).migrate end end.to raise_error(StandardError, /An error has occurred, this and all later migrations canceled/)