rails / jbuilder

Jbuilder: generate JSON objects with a Builder-style DSL
MIT License
4.34k stars 440 forks source link

Use new `params.expect` syntax instead of `params.require` #573

Closed jeromedalbert closed 2 months ago

jeromedalbert commented 2 months ago

Problem

PR https://github.com/rails/rails/pull/51674 updated controller generator templates in the Rails codebase. But, as DHH explained, we need to do the same update to templates in jbuilder, because they are used by default for new Rails apps.

Solution

Port the changes from https://github.com/rails/rails/pull/51674 to this codebase, only for Rails versions 8.0+:

cc @martinemde

MatheusRich commented 2 months ago

@jeromedalbert add a Changelog entry, please

jeromedalbert commented 2 months ago

@MatheusRich This project does not seem to have a Changelog file. 😅

After looking at this:

https://github.com/rails/jbuilder/blob/acf44b86eebeb229dea651f2a8ec4bdd64a5328c/jbuilder.gemspec#L26

It looks like changelogs are made directly from GitHub at release time: https://github.com/rails/jbuilder/releases

So I guess I'm good on my end, but let me know if I missed something.