Skip to content

Conversation

@malachheb
Copy link

Added the function 'version_at' to get a copy of the object at a given date.

@dblock
Copy link
Collaborator

dblock commented May 27, 2014

Interesting. I'd be down with merging this if we can resolve a few things.

  • I think version_at should take a Time, 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_at a time after the record has been deleted, it should return nil.
  • Needs more edge case tests (time before, during, after, etc.).
  • You need to update CHANGELOG.

@malachheb
Copy link
Author

  • ok for Time as parameter, rename the function to at, tests and CHANGELOG.
  • return nil after the record has been deleted is valid only for embeds documents, because at cannot be called from deleted document. Also at should return nil if the time is before the created_at document.

@dblock
Copy link
Collaborator

dblock commented May 27, 2014

Makes sense re: nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants