Remove OpenStruct references from Jbuilder#567
Conversation
|
With Ruby 3.4, a newly created Rails application immediately shows a warning about With this patch, such warning won't be appeared since it completely removes the |
|
As a author of #562 , |
|
I would also like to hear from other maintainers. |
It looks like Ruby 3.3.5 (released today) emits the warning as well.
|
According to https://bugs.ruby-lang.org/issues/20737 , this warning will not appear in Ruby 3.3.6 and future 3.3 versions of Rubies. |
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jbuilder](https://redirect.github.com/rails/jbuilder) ([changelog](https://redirect.github.com/rails/jbuilder/releases/tag/v2.13.0)) | `2.12.0` -> `2.13.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>rails/jbuilder (jbuilder)</summary> ### [`v2.13.0`](https://redirect.github.com/rails/jbuilder/releases/tag/v2.13.0) [Compare Source](https://redirect.github.com/rails/jbuilder/compare/v2.12.0...v2.13.0) #### What's Changed - Redirect to `@record` or path in controller generator by [@​jeromedalbert](https://redirect.github.com/jeromedalbert) in [https://github.com/rails/jbuilder/pull/569](https://redirect.github.com/rails/jbuilder/pull/569) - Return early from collection partial rendering if blank by [@​tylerjc](https://redirect.github.com/tylerjc) in [https://github.com/rails/jbuilder/pull/560](https://redirect.github.com/rails/jbuilder/pull/560) - Add missing ':see_other' status code in generated destroy controller method by [@​ldeld](https://redirect.github.com/ldeld) in [https://github.com/rails/jbuilder/pull/538](https://redirect.github.com/rails/jbuilder/pull/538) - Remove OpenStruct references from Jbuilder by [@​mtsmfm](https://redirect.github.com/mtsmfm) in [https://github.com/rails/jbuilder/pull/567](https://redirect.github.com/rails/jbuilder/pull/567) - Use new `params.expect` syntax instead of `params.require` by [@​jeromedalbert](https://redirect.github.com/jeromedalbert) in [https://github.com/rails/jbuilder/pull/573](https://redirect.github.com/rails/jbuilder/pull/573) #### New Contributors - [@​jeromedalbert](https://redirect.github.com/jeromedalbert) made their first contribution in [https://github.com/rails/jbuilder/pull/570](https://redirect.github.com/rails/jbuilder/pull/570) - [@​tylerjc](https://redirect.github.com/tylerjc) made their first contribution in [https://github.com/rails/jbuilder/pull/560](https://redirect.github.com/rails/jbuilder/pull/560) - [@​ldeld](https://redirect.github.com/ldeld) made their first contribution in [https://github.com/rails/jbuilder/pull/538](https://redirect.github.com/rails/jbuilder/pull/538) - [@​mtsmfm](https://redirect.github.com/mtsmfm) made their first contribution in [https://github.com/rails/jbuilder/pull/567](https://redirect.github.com/rails/jbuilder/pull/567) **Full Changelog**: rails/jbuilder@v2.12.0...v2.13.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/powerhome/power-web-development-interview). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43NC4xIiwidXBkYXRlZEluVmVyIjoiMzguNzQuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
While I was looking at #562, I noticed
OpenStructnever responsesmapandcountmethod.docker run rubylang/all-ruby ./all-ruby -e 'require "ostruct"; p [:map, :count].map {|m| OpenStruct.new({}).respond_to?(m) }'So, even we remove
OpenStructrelated codes completely, Jbuilder can handle themBut if an OpenStruct instance has both
mapandcountfields, it would be broken.So, strictly speaking, this change is a breaking change.
What do you think?
If you don't agree with this change, you can just close this PR.
I just want to tell you another possibility.