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

Possible to overwrite created_at ? #1809

Closed
arnolicious opened this issue Jul 1, 2024 · 2 comments
Closed

Possible to overwrite created_at ? #1809

arnolicious opened this issue Jul 1, 2024 · 2 comments

Comments

@arnolicious
Copy link

Hey all, great library, absolutely loving it so far!

I'm wondering if there's any way to overwrite / pass my own dates into the automatically tracked created_at (and updated_at) fields.

My use case is the import of some external data, which already has an older creation date.
I assume I could get around this problem by creating a separate field, but that doesn't seem very elegant :D

@radex
Copy link
Collaborator

radex commented Jul 4, 2024

Sure, you can do record._setRaw('created_at', timestamp)

@arnolicious
Copy link
Author

Oh great, thanks!

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

No branches or pull requests

2 participants