Skip to content

id = attributes.delete(@model.primary_key) #36

@ghost

Description

Why this:

id = attributes.delete(@model.primary_key) in:

  def call(_obj, args, _ctx)
      attributes = args[@param_key].to_h
      id = attributes.delete(@model.primary_key)
      record = @model.find(id)
      record.update!(Services::NestedAttributes.call(@model, attributes))
      record
    end

here: https://github.com/tb/northwind-graphql-ruby/blob/master/app/graphql/functions/update.rb ?

Is the .update! method in Rails chcking for id?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions