KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
The #new_record? function determines if a record has been saved. But it is always false in the after_save hook. Is there a way to determine whether the record is a newly created record or an old one from update? I'm hoping not to use another callback such as before_create to set a flag in the model or require another query into the db. Any advice is appreciated. Edit: Need to determine it in after_save hook, and for my particular use case, there is no updated_at or updated_on timestamp
Tags (comma-separated)
Save Edits
Cancel