Have you heard of the assert_valid_keys method for the Hash class in Rails?