Skip to content

Commit

Permalink
Support Rails 7.1 (#180)
Browse files Browse the repository at this point in the history
`db:test:load` was removed in rails/rails#45870
  • Loading branch information
owst authored Nov 3, 2023
1 parent 33bc86c commit fbd9c28
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/standalone_migrations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
9 changes: 4 additions & 5 deletions standalone_migrations.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@ Gem::Specification.new do |s|

if s.respond_to? :add_runtime_dependency then
s.add_runtime_dependency(%q<rake>.freeze, [">= 10.0"])
s.add_runtime_dependency(%q<activerecord>.freeze, [">= 6.0.0", "< 7.1.0"])
s.add_runtime_dependency(%q<railties>.freeze, [">= 6.0.0", "< 7.1.0"])
s.add_runtime_dependency(%q<activerecord>.freeze, [">= 6.0.0", "< 7.2"])
s.add_runtime_dependency(%q<railties>.freeze, [">= 6.0.0", "< 7.2"])
s.add_runtime_dependency(%q<nokogiri>.freeze, ["~> 1.14"])
else
s.add_dependency(%q<rake>.freeze, [">= 10.0"])
s.add_dependency(%q<activerecord>.freeze, [">= 6.0.0", "< 7.1.0"])
s.add_dependency(%q<railties>.freeze, [">= 6.0.0", "< 7.1.0"])
s.add_dependency(%q<activerecord>.freeze, [">= 6.0.0", "< 7.2"])
s.add_dependency(%q<railties>.freeze, [">= 6.0.0", "< 7.2"])
s.add_dependency(%q<nokogiri>.freeze, ["~> 1.14"])
end
end

0 comments on commit fbd9c28

Please sign in to comment.