Method: ActionController::ParamsWrapper::ClassMethods#inherited

Defined in:
actionpack/lib/action_controller/metal/params_wrapper.rb

#inherited(klass) ⇒ Object

Sets the default wrapper key or model which will be used to determine wrapper key and attribute names. Called automatically when the module is inherited.



244
245
246
247
248
249
250
251
# File 'actionpack/lib/action_controller/metal/params_wrapper.rb', line 244

def inherited(klass)
  if klass._wrapper_options.format.any?
    params = klass._wrapper_options.dup
    params.klass = klass
    klass._wrapper_options = params
  end
  super
end