-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Labels
Description
I recently updated DMP OPIDoR to Rails 7 & Ruby 3.1.
The upgrade has been fairly easy, the most notable changes coming from Ruby 3.1. I'll send a PR for this update.
https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/
Ruby 3.1 brings an autocomplete feature in the Rails console. It can be usefull if you use it a lot.
The main changes is a new syntax suger for hash literals, they tried to add something a bit similar to ES6 Javascript ;
Values in Hash literals and keyword arguments can be omitted.
{x:, y:} is syntax sugar for {x: x, y: y}.
foo(x:, y:) is syntax sugar for foo(x: x, y: y).
This change triggers a lot a rubocop warning, as it now expects apps to use this new syntax.
It can be automatically fixed by Rubocop. We might have to discuss if we keep this change or if we deactivate the rule, as the syntax is not really clear.