slice!(*keys)
public
Removes all errors except the given keys. Returns a hash containing
the removed errors.
person.errors.keys
person.errors.slice!(:age, :gender)
person.errors.keys
# File activemodel/lib/active_model/errors.rb, line 120
def slice!(*keys)
keys = keys.map(&:to_sym)
@details.slice!(*keys)
@messages.slice!(*keys)
end