Skip to content

Commit

Permalink
Fix attempt to set created_at for a document that has already been de…
Browse files Browse the repository at this point in the history
…leted
  • Loading branch information
priceline-rosenfeld committed Dec 11, 2024
1 parent 337ba30 commit 05695c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoid/timestamps/created.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Created
# @example Set the created at time.
# person.set_created_at
def set_created_at
if !timeless? && !created_at
if !timeless? && !created_at && !frozen?
time = Time.configured.now
self.updated_at = time if is_a?(Updated) && !updated_at_changed?
self.created_at = time
Expand Down

0 comments on commit 05695c6

Please sign in to comment.