rails/rails — pull request #11624 by Nerian (2013-07-27 16:43:57+00:00)
Title: Modify the Hash#assert_valid_keys error message to provide better information.

Modify the Hash#assert_valid_keys error message so that:

* It shows the valid keys.
* Show the wrong value as it was entered.

# Previously
```ruby
{ :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
=> ArgumentError: Unknown key: failore
{ 'failore' => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
=> ArgumentError: Unknown key: failore
```

#Now
```ruby
{ 'failore' => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
=> ArgumentError: Unknown key: "failore". Valid keys are: :failure, :funny

{ :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
=> ArgumentError: Unknown key: :failore. Valid keys are: :failure, :funny
```