-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
instance.set('id', 1) returns undefined #4702
Copy link
Copy link
Closed
Labels
good first issueFor issues. An issue that is a good choice for first-time contributors.For issues. An issue that is a good choice for first-time contributors.type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueFor issues. An issue that is a good choice for first-time contributors.For issues. An issue that is a good choice for first-time contributors.type: bugDEPRECATED: replace with the "bug" issue typeDEPRECATED: replace with the "bug" issue type