Method: JSONAPI::Processor#remove_to_one_relationship

Defined in:
lib/jsonapi/processor.rb

#remove_to_one_relationshipObject



276
277
278
279
280
281
282
283
284
# File 'lib/jsonapi/processor.rb', line 276

def remove_to_one_relationship
  resource_id = params[:resource_id]
  relationship_type = params[:relationship_type].to_sym

  resource = resource_klass.find_by_key(resource_id, context: context)
  result = resource.remove_to_one_link(relationship_type)

  return JSONAPI::OperationResult.new(result == :completed ? :no_content : :accepted)
end