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

:next_version method doesn't return anything for the most recent version #200

Closed
batter opened this issue Feb 5, 2013 · 0 comments
Closed
Assignees
Milestone

Comments

@batter
Copy link
Collaborator

batter commented Feb 5, 2013

Say you have a model named Document which declares has_paper_trail.

> d = Document.create!
=>  #<Document id: 1, name: nil>
> d.update_attribute(:name, 'Ben')
=> true
> d.update_attribute(:name, 'Andy')
=> true
> d.previous_version
=> #<Document id: 1, name: "Ben">
> d.previous_version.next_version
=> nil # should return the live version (#<Document id: 1, name: "Andy">)

The next_version method is currently broken, in that if it is called on the latest reified version of a model prior to the live model, it returns nil when it should actually return the live model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant