mongoid-history
mongoid-history copied to clipboard
Version at
Added the function 'version_at' to get a copy of the object at a given date.
Interesting. I'd be down with merging this if we can resolve a few things.
- I think
version_atshould take aTime, not a series of numbers. - What do you think about calling this just
at? - Doesn't handle records being deleted. I think if you do a
version_ata time after the record has been deleted, it should returnnil. - Needs more edge case tests (time before, during, after, etc.).
- You need to update CHANGELOG.
- ok for
Timeas parameter, rename the function toat, tests and CHANGELOG. - return
nilafter the record has been deleted is valid only for embeds documents, becauseatcannot be called from deleted document. Alsoatshould returnnilif the time is before thecreated_atdocument.
Makes sense re: nil.