Skip to content
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

deprecate passing nil as model arg instead of raising ArgumentError #50931

Merged
merged 2 commits into from Feb 1, 2024

Conversation

cjilbert504
Copy link
Contributor

Motivation / Background

This Pull Request has been created because we want to first show a deprecation warning about changing the default value of the model: argument to form_with

Detail

This Pull Request removes the changes introduced in #49943 since these changes are breaking changes. Instead we will first deprecate the current default value of the model: argument in form_with.

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

actionview/CHANGELOG.md Outdated Show resolved Hide resolved
@cjilbert504 cjilbert504 force-pushed the deprecate-nil-form-with-model-arg branch 2 times, most recently from 8672817 to 5e91597 Compare February 1, 2024 13:38
@cjilbert504 cjilbert504 force-pushed the deprecate-nil-form-with-model-arg branch from 5e91597 to ffd6fcf Compare February 1, 2024 13:40
@cjilbert504
Copy link
Contributor Author

@ghiculescu @skipkayhil - Thank you both so much for the feedback/review/suggestions. This is my first time working with the deprecation warning stuff 😅. Anyway, I've made the changes requested.

@jhawthorn
Copy link
Member

Thank you!

@jhawthorn jhawthorn merged commit 9d0a913 into rails:main Feb 1, 2024
3 of 4 checks passed
@cjilbert504
Copy link
Contributor Author

Thanks @jhawthorn!!!! ❤️💎

@cjilbert504 cjilbert504 deleted the deprecate-nil-form-with-model-arg branch February 2, 2024 01:20
carlosantoniodasilva added a commit to heartcombo/simple_form that referenced this pull request Apr 9, 2024
Rails main changed `object` to be `false` instead of `nil`, causing the
specific check we were doing for `object.nil?` to fail, and the custom
errors were not displaying for forms without an object. Our test suite
caught that, and the fix is to simply not check specifically for `nil?`,
but just whether we have an object or not, which should account for both
`nil`/`false` versions.

It's a small backwards incompatibility, probably not something worth
changing the framework for, but one worth mentioning.

Source is likely to be:
- rails/rails#49943
- rails/rails#50931
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants