MushroomObserver / mushroom-observer

A website for sharing observations of mushrooms.
https://mushroomobserver.org
MIT License
78 stars 25 forks source link

Give observation form partials explicit locals #2255

Closed nimmolo closed 2 months ago

nimmolo commented 2 months ago

(Cleaning up after my recent PRs)

Rails 7.1 allows declaring the accepted locals for a partial explicitly in a comment at the top of the file.

I like the convention, because it makes me less sloppy passing locals. Took this opportunity to refactor local args a bit in the form, too.

Note that you don't have to declare the accepted locals in a partial, but if you do, and don't pass the locals in, or you pass a local you didn't declare, Rails will throw a missing arg error.

coveralls commented 2 months ago

Coverage Status

coverage: 94.414%. remained the same when pulling 34bbc90cbef3b3688043c10d8a8483cf401df225 on change_translation_string_tags into 82c8f7763292acb2f1c91598633f933da7f71a46 on main.