-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
Labels:
In Mongoid, #persisted? returns false only for new documents:
def persisted? !new_record? end
But if Mongoid strives to adhere to the ActiveModel API (and it seems to), #persisted? should also return false for documents that have been destroyed. From the changelog of ActiveModel 3.0.0:
> A model is persisted if it's not a new_record? and it was not destroyed?
Which would be:
def persisted? !new_record? && !destroyed? end
I'm posting here instead of submitting a patch because I don't know Mongo well, so I wonder: is this a Mongo thing, or is it a bug?