Method: JSONAPI::Processor#create_to_many_relationship
- Defined in:
- lib/jsonapi/processor.rb
#create_to_many_relationship ⇒ Object
243 244 245 246 247 248 249 250 251 252 |
# File 'lib/jsonapi/processor.rb', line 243 def create_to_many_relationship resource_id = params[:resource_id] relationship_type = params[:relationship_type].to_sym data = params[:data] resource = resource_klass.find_by_key(resource_id, context: context) result = resource.create_to_many_links(relationship_type, data) return JSONAPI::OperationResult.new(result == :completed ? :no_content : :accepted) end |