-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
[#5851] Review new framework defaults #8120
Open
gbp
wants to merge
22
commits into
develop
Choose a base branch
from
review-new-framework-defaults
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
gbp
force-pushed
the
review-new-framework-defaults
branch
from
April 16, 2024 09:03
4ed6ccb
to
3af87a4
Compare
This is on deployed to staging. I'm thinking this might be good to merge but will see if there are issues when testing other features on there. |
gbp
commented
Apr 30, 2024
gbp
force-pushed
the
review-new-framework-defaults
branch
2 times, most recently
from
December 17, 2024 06:20
0b4ab2b
to
2731159
Compare
Ensure categories have parent associations. This change enforces parent associations for categories to support Rails 5.0's `active_record.belongs_to_required_by_default` setting.
Disable parent/child relation validation. This change is needed so test examples pass after enabling support for Rails 5.0's `active_record.belongs_to_required_by_default` setting.
Use test factory so the instance has belongs_to associated objects. This change is needed so this test example passes after enabling support for Rails 5.0's `active_record.belongs_to_required_by_default` setting.
Configure Comment#user to be optional. Although we have a DB not null constraint we need to allow user to be optional as the controller calls `invalid?` and to allow the form to be rendered prior login.
gbp
force-pushed
the
review-new-framework-defaults
branch
from
December 20, 2024 16:50
2731159
to
3b3765f
Compare
Configure optional associations. This change is needed so test examples pass after enabling support for Rails 5.0's `active_record.belongs_to_required_by_default` setting.
Check errors include message for required belongs_to associations. This change ensures these test examples will pass after enabling support for Rails 5.0's `active_record.belongs_to_required_by_default` setting.
In the test environment some `script` test examples look at output stderr. When doing Rails upgrades we sometimes see deprecation warnings on boot and these examples will fail. This change adds a new ENV which can be set to silence these warnings.
Ensures translation objects are correctly build with `globalized_model` association. This change is needed so test examples pass after enabling support for Rails 5.0's `active_record.belongs_to_required_by_default` setting.
Added so we can review these options.
Add examples where we already validated belongs_to associations. These additional test examples will be useful after we turn on Rails 5.0's `active_record.belongs_to_required_by_default` setting as we will be able to clean up the `validates presence` calls.
Don't validate this association is present as we already have validation in place with a custom error message.
These validations are now covered by the relevant belongs_to association.
This is already called from an before action hook. Calling it a second time works until we enable the Rails 6.1's framework default configuration options due to Rails now tracking built associated objects resulting in two TrackThing instances, but only one being assign values for required attributes.
So there is better visibility why these have been set without going into the git commit history.
It appears Rails 6.1's `active_record.has_many_inversing` configuration option change has introduced a regression in Rails which causes issues with our code base. We expect the follow to work, but with this configuration options this breaks due to how we associated objects via FactoryBot in our test suite: user = User.new info_request = InfoRequest.new(user: user) comment = Comment.create!(info_request: info_request, user: user)
gbp
force-pushed
the
review-new-framework-defaults
branch
from
December 20, 2024 16:52
3b3765f
to
6925bdf
Compare
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.
Relevant issue(s)
Fixes #5851
What does this do?
Lazy review of the new framework defaults. Testing to see if the specs pass with the new defaults used.
Why was this needed?
So we can upgrade Rails further.