3 module ActiveSupport
#:nodoc:
4 module CoreExtensions
#:nodoc:
6 # Return a hash that includes everything but the given keys. This is useful for
7 # limiting a set of parameters to everything but a few known toggles:
9 # @person.update_attributes(params[:person].except(:admin))
11 # Returns a new hash without the given keys.
16 # Replaces the hash without the given keys.
18 keys
.map
! { |key
| convert_key(key
) } if respond_to
?(:convert_key)
19 keys
.each
{ |key
| delete(key
) }