Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version at #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Version at #104

wants to merge 2 commits into from

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