Rails 6 fixes without (alias of slice) method on ActiveSupport::HashWithIndifferent for sybmol arguments.
is aliased to
When symbol argument was sent to
it used to return the same object.
It did not consider symbol arguments
Let’s take an example to demonstrate the use case.
Before Rails 6
Now, if we want to fetch a new hash
without key value pair having key
As we can see from the result above,
the resultant hash has the key passed as a symbol argument to
Whereas it works if we pass string argument as given below.
After Rails 6
Rails 6 has fixed the bug describe above.
if we try to perform the same operation,
it gives the expected result with a hash
having key-value pair having key
from the result.
It also works with string argument to
All this works as shows above with
except method as well.
Subscribe to Ruby in Rails
Get the latest posts delivered right to your inbox