-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve undefined method migration_context
when upgrading to rails 7.2
#162
Merged
+607
−79
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avinhurry
force-pushed
the
fix-undefined-method-migration-context-2
branch
8 times, most recently
from
August 15, 2024 20:24
4062cb9
to
281095a
Compare
avinhurry
changed the title
Add CI tests for rails 7.2
[DO NOT REVIEW] Add CI tests for rails 7.2
Aug 15, 2024
avinhurry
force-pushed
the
fix-undefined-method-migration-context-2
branch
2 times, most recently
from
August 15, 2024 21:05
133600c
to
a9fc34d
Compare
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/
avinhurry
force-pushed
the
fix-undefined-method-migration-context-2
branch
from
August 15, 2024 21:09
a9fc34d
to
edbbd58
Compare
avinhurry
changed the title
[DO NOT REVIEW] Add CI tests for rails 7.2
[DO NOT REVIEW] Resolve undefined method Aug 15, 2024
migration_context
when upgrading to rails 7.2
avinhurry
force-pushed
the
fix-undefined-method-migration-context-2
branch
3 times, most recently
from
August 15, 2024 21:38
7b63d87
to
406ae49
Compare
Ruby 2.7 reached its EOL on 2023-03-31
avinhurry
force-pushed
the
fix-undefined-method-migration-context-2
branch
from
August 15, 2024 21:40
406ae49
to
32dc3b9
Compare
To maintain test coverage
avinhurry
changed the title
[DO NOT REVIEW] Resolve undefined method
Resolve undefined method Aug 15, 2024
migration_context
when upgrading to rails 7.2migration_context
when upgrading to rails 7.2
This was referenced Aug 15, 2024
asatwal
approved these changes
Aug 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
ericaporter
approved these changes
Aug 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 thanks for picking this up @avinhurry
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
We are getting the following error when upgrading our apps to rails version 7.2:
Publish: Bump rails from 7.1.3.4 to 7.2.0 publish-teacher-training#4445
Apply: Bump rails from 7.1.3.4 to 7.2.0 apply-for-teacher-training#9692
Register: Bump rails from 7.1.3.4 to 7.2.0 register-trainee-teachers#4562
This is because of breaking changes and deprecation in rails 7.2:
The
connection
method was changed towith_connection
The oldest Ruby version required for rails 7.2 is 3.1
The deprecation of
fixture_path
meant that rspec had to be upgradedDropping Ruby 2.7 tests in CI as that version has reached it's EOL.
This PR also sets functional versions of the
rspec-rails
andrails gems
depending on what version of rails you are using.