Skip to content

Commit

Permalink
Removes below 6.0 test_helper dead code and add a gemfile with Active…
Browse files Browse the repository at this point in the history
…Record 7.0 for CI tests
CharlesDelannoy committed Dec 11, 2023
1 parent 627eed6 commit f0fd295
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
@@ -66,6 +66,8 @@ jobs:
gemfile: gemfiles/without_strong_migrations.gemfile
- ruby: "3.0"
gemfile: gemfiles/activerecord61.gemfile
- ruby: "3.0"
gemfile: gemfiles/activerecord70.gemfile
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
services:
15 changes: 15 additions & 0 deletions gemfiles/activerecord70.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gemspec path: '..'

gem 'activerecord', '~> 7.0.0'
gem 'bundler'
gem 'minitest', '>= 5'
gem 'mocha'
gem 'pg', '~> 1.4.3'
gem 'pry'
gem 'pry-coolline'
gem 'rake'
gem 'rubocop'
4 changes: 1 addition & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -63,10 +63,8 @@ def run_migration(direction = :up)
migrator =
if Gem::Requirement.new('>=7.1.0').satisfied_by?(Gem::Version.new(::ActiveRecord::VERSION::STRING))
ActiveRecord::Migrator.new(direction, [@migration], @schema_migration, @internal_metadata)
elsif Gem::Requirement.new('>=6.0.0').satisfied_by?(Gem::Version.new(::ActiveRecord::VERSION::STRING))
ActiveRecord::Migrator.new(direction, [@migration], @schema_migration)
else
ActiveRecord::Migrator.new(direction, [@migration])
ActiveRecord::Migrator.new(direction, [@migration], @schema_migration)
end
migrator.migrate
end

0 comments on commit f0fd295

Please sign in to comment.