Method: JSONAPI::Processor#remove_to_many_relationship

Defined in:
lib/jsonapi/processor.rb

#remove_to_many_relationshipObject



265
266
267
268
269
270
271
272
273
274
# File 'lib/jsonapi/processor.rb', line 265

def remove_to_many_relationship
  resource_id = params[:resource_id]
  relationship_type = params[:relationship_type].to_sym
  associated_key = params[:associated_key]

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

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