Notes posted by matthewtuck
RSS feed![Default_avatar_30](https://www.gravatar.com/avatar/106d7ac8a2e9029d80bdf5a252e792cb?default=http://apidock.com/images/default_avatar_30.png&size=30)
0 thanks
Non-existent key semantics changed.
For Rails 4.0, the behaviour of this has changed when you pass a key that isn’t in the hash.
3.2 (undocumented):
{ a: 1, b: 2 }.extract!(:a, :x) # => {:a=>1, :x => nil}
4.0 (as per docs):
{ a: 1, b: 2 }.extract!(:a, :x) # => {:a=>1}
The 4.0 behaviour is now consistent with the behaviour of slice, the 3.2 behaviour was not.