rails/rails — pull request #7010 by insside (2012-07-09 08:56:36+00:00)
Title: Added assert_required_keys method to hash

Similar to assert_valid_keys method, assert_required_keys method validates if all required_keys that was passed exists in hash keys

For example
{ :year => 2012 }.assert_required_keys(:year, :month) # => raises "ArgumentError: Key month is required"

Useful when you need check if required options was passed