Skip to content

Instantly share code, notes, and snippets.

@stevenday
Created September 18, 2015 11:28
Show Gist options
  • Save stevenday/e6618ac4969d24e27bf7 to your computer and use it in GitHub Desktop.
Save stevenday/e6618ac4969d24e27bf7 to your computer and use it in GitHub Desktop.
BSON::Document bug?
attributes = BSON::Document.new
attributes["test"] = nil
(attributes["test"] ||= {}).merge!({"test" => "test})
# You'd expect attributes["test"] to be {"test" => "test"}
# here, but it's actually {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment