Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

createdAt will be updated on upsert (updateOrCreate) call #11

Open
0ff opened this issue Jun 5, 2015 · 1 comment
Open

createdAt will be updated on upsert (updateOrCreate) call #11

0ff opened this issue Jun 5, 2015 · 1 comment

Comments

@0ff
Copy link

0ff commented Jun 5, 2015

There is a quirk in this mixin: if you upsert a model (i.e. you just know the id and properties, but you don't want to find it first) the createdAt-Timestamp is updated, too. This must not happen, of course.
I fear it's related to the lb-ds-juggler's implementation of default values.

Can you think of a solution besides querying for the model everytime?

See PR #10 for a breaking test. I'm not even sure if this can be fixed in the mixin. If not, it should at least be clearly stated in the readme.

@0ff 0ff changed the title createdAt will be updated on upsert (findOrCreate) call createdAt will be updated on upsert (updateOrCreate) call Jun 5, 2015
@xixilive
Copy link

It should ENFORCE unset createdAt property before any update operation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants