Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreatedAt key is override in update call #49

Open
isacaraujo opened this issue Feb 16, 2015 · 1 comment
Open

CreatedAt key is override in update call #49

isacaraujo opened this issue Feb 16, 2015 · 1 comment

Comments

@isacaraujo
Copy link

Teers,

In lib/database file, the method db.add() always set createdAt key, but this method is called in db.update too, and the createdAt key is override.

https://github.com/hoodiehq/hoodie-plugins-api/blob/master/lib/database.js#L46

I don't know if this is a best practice, but i added a hotfix on like 46:

46   if (!doc.createdAt) doc.createdAt = new Date();

Thanks

@janl
Copy link
Contributor

janl commented Feb 17, 2015

Good find, I’ll take a look. If you fancy, wanna write a test case that demonstrates the issue? This will help us to resolve this quicker.

@janl janl removed their assignment Jan 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants