Module ActiveSupport::CoreExtensions::Hash::Except
In: vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb

Return a hash that includes everything but the given keys. This is useful for limiting a set of parameters to everything but a few known toggles:

  @person.update_attributes(params[:person].except(:admin))

Methods

except   except!  

Public Instance methods

Returns a new hash without the given keys.

[Source]

    # File vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb, line 12
12:         def except(*keys)
13:           rejected = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys)
14:           reject { |key,| rejected.include?(key) }
15:         end

Replaces the hash without only the given keys.

[Source]

    # File vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb, line 18
18:         def except!(*keys)
19:           replace(except(*keys))
20:         end

[Validate]