Skip to content

Commit

Permalink
fix: don't provide Schema::Migration in Rails >= 7.0
Browse files Browse the repository at this point in the history
This is no longer needed in Rails 7+
  • Loading branch information
adamcooke committed Nov 2, 2023
1 parent 48263f8 commit 57f2857
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@
end

config.before(:suite) do
ActiveRecord::MigrationContext.new(File.expand_path('../db/migrate', __dir__),
ActiveRecord::SchemaMigration).migrate(nil)
context = if Gem::Version.new(Rails.version) >= Gem::Version.new('7.0')
ActiveRecord::MigrationContext.new(File.expand_path('../db/migrate', __dir__))
else
ActiveRecord::MigrationContext.new(File.expand_path('../db/migrate', __dir__),
ActiveRecord::SchemaMigration)
end
context.migrate(nil)
end
end

0 comments on commit 57f2857

Please sign in to comment.