hash_one = { "name" => "Steve"}
# => {"name"=>"Steve"}
hash_two = { name: "Steve"}
# => {:name=>"Steve"}
hash_one == hash_two
# => false
hash_one.with_indifferent_access == hash_two.with_indifferent_access
# => true
Last active
March 16, 2022 15:35
-
-
Save stevepolitodesign/6cab174e5c1e72cc5d33e1eb877bee53 to your computer and use it in GitHub Desktop.
Use with_indifferent_access to format a hash for reliable equality checks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment