Class: ActionController::Parameters

Inherits:
ActiveSupport::HashWithIndifferentAccess
  • Object
show all
Defined in:
lib/scrub_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#scrubbed_keysObject

Returns the value of attribute scrubbed_keys.



8
9
10
# File 'lib/scrub_params.rb', line 8

def scrubbed_keys
  @scrubbed_keys
end

Instance Method Details

#scrub!Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/scrub_params.rb', line 10

def scrub!
  self.scrubbed_keys = []
  each_pair do |k, v|
    self[k] = scrub_value(k, v)
  end
  if scrubbed_keys.any?
    ActiveSupport::Notifications.instrument("scrubbed_parameters.action_controller", keys: scrubbed_keys)
  end
  self
end