From fbd9c288f9bbf2e3e725d9bc6bc0ec1fd9f5a5ba Mon Sep 17 00:00:00 2001 From: Owen Stephens Date: Fri, 3 Nov 2023 15:55:42 +0000 Subject: [PATCH] Support Rails 7.1 (#180) `db:test:load` was removed in https://github.com/rails/rails/pull/45870 --- .github/workflows/CI.yml | 2 ++ Gemfile | 4 ++-- spec/standalone_migrations_spec.rb | 6 +++--- standalone_migrations.gemspec | 9 ++++----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f9dd7d3..c7cfbd0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,6 +19,8 @@ jobs: activerecord: - '6.0' - '6.1' + - '7.0' + - '7.1' name: Ruby ${{ matrix.ruby }} / ActiveRecord ${{ matrix.activerecord }} env: AR: ~> ${{ matrix.activerecord }} diff --git a/Gemfile b/Gemfile index 676bc05..27477f5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source 'https://rubygems.org' gem 'rake', '>= 10.0' -gem 'activerecord', ENV['AR'] ? ENV['AR'].split(",") : [">= 6.0.0", "< 7.1.0"] -gem 'railties', ENV['AR'] ? ENV['AR'].split(",") : [">= 6.0.0", "< 7.1.0"] +gem 'activerecord', ENV['AR'] ? ENV['AR'].split(",") : [">= 6.0.0", "< 7.2"] +gem 'railties', ENV['AR'] ? ENV['AR'].split(",") : [">= 6.0.0", "< 7.2"] gem 'nokogiri', "~> 1.14" group :dev do diff --git a/spec/standalone_migrations_spec.rb b/spec/standalone_migrations_spec.rb index c17a7ca..69e95b8 100644 --- a/spec/standalone_migrations_spec.rb +++ b/spec/standalone_migrations_spec.rb @@ -18,7 +18,7 @@ def migration(name) end def schema - ENV['SCHEMA'] || ActiveRecord::Tasks::DatabaseTasks.schema_file(ActiveRecord::Base.schema_format) + ENV['SCHEMA'] || 'db/schema.rb' end def run(cmd) @@ -296,13 +296,13 @@ def down describe 'db:test:load' do it 'loads' do write(schema, "puts 'LOADEDDD'") - expect(run("rake db:test:load")).to match(/LOADEDDD/) + expect(run("rake db:test:load_schema")).to match(/LOADEDDD/) end it "fails without schema" do schema_path = schema `rm -rf #{schema_path}` if File.exist?(schema_path) - expect { run("rake db:test:load") }.to raise_error(/try again/) + expect { run("rake db:test:load_schema") }.to raise_error(/try again/) end end diff --git a/standalone_migrations.gemspec b/standalone_migrations.gemspec index 3026a53..15583d4 100644 --- a/standalone_migrations.gemspec +++ b/standalone_migrations.gemspec @@ -66,14 +66,13 @@ Gem::Specification.new do |s| if s.respond_to? :add_runtime_dependency then s.add_runtime_dependency(%q.freeze, [">= 10.0"]) - s.add_runtime_dependency(%q.freeze, [">= 6.0.0", "< 7.1.0"]) - s.add_runtime_dependency(%q.freeze, [">= 6.0.0", "< 7.1.0"]) + s.add_runtime_dependency(%q.freeze, [">= 6.0.0", "< 7.2"]) + s.add_runtime_dependency(%q.freeze, [">= 6.0.0", "< 7.2"]) s.add_runtime_dependency(%q.freeze, ["~> 1.14"]) else s.add_dependency(%q.freeze, [">= 10.0"]) - s.add_dependency(%q.freeze, [">= 6.0.0", "< 7.1.0"]) - s.add_dependency(%q.freeze, [">= 6.0.0", "< 7.1.0"]) + s.add_dependency(%q.freeze, [">= 6.0.0", "< 7.2"]) + s.add_dependency(%q.freeze, [">= 6.0.0", "< 7.2"]) s.add_dependency(%q.freeze, ["~> 1.14"]) end end -