This blog is part of our Rails 6 series.
Rails 6.0.0.rc1 was recently released.
Rails 6 added
This will help in creating a hash from an enumerator with default or fetched
Before Rails 6, we can achieve this by calling
takes both value or a block as a parameter.
Let’s checkout how it works.
Let’s create a hash from an array in Rails 5.2 using
Now let’s create the same hash from the array using
in Rails 6.
Here is the relevant