Skip to content

instance.set('id', 1) returns undefined #4702

@tad-lispy

Description

@tad-lispy

Seems like setting a value of a field that is a primary key returns undefined. Consider this snippet:

Foo
  .findOne()
  .then( (foo) -> foo.set('id', 100).save() )

It throws TypeError: Cannot read property 'save' of undefined. Instead of this I would expect a meaningful error to be thrown when I try to save the instance.

Note: It actually doesn't matter if the field name is id or what it's type is. The fact that it is a primary key is relevant.

I'm using v. 3.12.0 with sqlite dialect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueFor issues. An issue that is a good choice for first-time contributors.type: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions