Method: Scimitar::ResourcesController#update
- Defined in:
- app/controllers/scimitar/resources_controller.rb
#update(&block) ⇒ Object
PATCH (update)
A variant of #create where you’re again passed the resource ID (in “your” domain) to look up, but then a Hash with patch operation details from the calling client. This can be passed to e.g. Scimitar::Resources::Mixin#from_scim_patch!.
Evaluate to the SCIM representation of the arising created record.
106 107 108 109 110 111 112 113 114 115 |
# File 'app/controllers/scimitar/resources_controller.rb', line 106 def update(&block) validate_request() # Params includes all of the PATCH data at the top level along with other # other Rails-injected params like 'id', 'action', 'controller'. These # are harmless given no namespace collision and we're only interested in # the 'Operations' key for the actual patch data. # render(json: yield(self.safe_params()[:id], self.safe_params().to_hash())) end |