Class: Api::ResourcesController::Base::PatchedParameters

Inherits:
ActionController::Parameters
  • Object
show all
Defined in:
app/controllers/api/resources_controller/base.rb

Instance Method Summary collapse

Instance Method Details

#require(key) ⇒ Object


322
323
324
325
326
327
328
329
330
331
332
# File 'app/controllers/api/resources_controller/base.rb', line 322

def require key
  begin
    super key
  rescue ActionController::ParameterMissing => e
    if self[key].nil? || self[key].empty?
      return PatchedParameters.new
    else
      raise e
    end
  end
end