Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve undefined method `migration_context'
When upgrading our apps to rails version 7.2: Publish: DFE-Digital/publish-teacher-training#4445 Apply: DFE-Digital/apply-for-teacher-training#9692 Register: DFE-Digital/register-trainee-teachers#4562 We are getting the following error: NoMethodError: undefined method `migration_context' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0x0000000000c620 raise ActiveRecord::PendingMigrationError if ActiveRecord::Base.connection.migration_context.needs_migration? This is because of breaking changes and deprecation in rails 7.2: ActiveRecord::Base.connection was changed to with_connection: - https://blog.saeloun.com/2024/07/01/rails-adds-activerecord-base-with-connection/ This deprecation meant that rspec had to be upgraded: - rspec/rspec-rails#2661 Set functional versions of the rspec-rails and rails gems depending on what version of rails you are using.
- Loading branch information