Another example: if you want to pass a hash as an argument, for example
This does not work:
MyTable.update_all { col_a: 1, col_b: 2 }
because {} is for the block, not for the hash
Adding pairs really works.
MyTable.update_all({ col_a: 1, col_b: 2 })
In the case of update_all, it takes up to 3 hashes as arguments, so it is important to specify which values are included in the hash.
justingordon
source share