Skip to content

Conversation

@joshuapinter
Copy link

@joshuapinter joshuapinter commented Jan 8, 2025

Returning the original version is a common use-case and is not as easy as it should be, particularly because calling reify on the first version returns nil, which is the object before it was created.

This method simply tries to reify from the second version, if it exists. If it doesn’t exist (i.e. there has not been any changes to the object), it falls back to self, which is the original and only version of the object.

Fixes #1204.

Thank you for your contribution!

Check the following boxes:

  • Wrote good commit messages.
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new
    code introduces user-observable changes.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

This PR has been automatically marked as stale due to inactivity.
The resources of our volunteers are limited.
If this is something you are committed to continue working on, please address any concerns raised by review and/or ping us again.
Thank you for all your contributions.

@github-actions github-actions bot added the Stale label Apr 9, 2025
@joshuapinter joshuapinter force-pushed the add_reify_original branch 2 times, most recently from aed329e to 50a3b7a Compare April 9, 2025 12:52
@joshuapinter
Copy link
Author

Okay, I've added specs and an entry into the CHANGELOG. This PR should be ready for review and merging.

Let me know if you would like to see any changes.

Thanks.

@github-actions github-actions bot removed the Stale label Apr 10, 2025
@github-actions
Copy link

github-actions bot commented Jul 9, 2025

This PR has been automatically marked as stale due to inactivity.
The resources of our volunteers are limited.
If this is something you are committed to continue working on, please address any concerns raised by review and/or ping us again.
Thank you for all your contributions.

@github-actions github-actions bot added the Stale label Jul 9, 2025
@joshuapinter
Copy link
Author

@fatkodima This PR isn't stale. It should be good to go now. I've added specs and a CHANGELOG entry. Can you take a look and let me know if anything else needs to be done for it to be merged?

Many thanks!

@fatkodima fatkodima removed the Stale label Jul 9, 2025
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

This PR has been automatically marked as stale due to inactivity.
The resources of our volunteers are limited.
If this is something you are committed to continue working on, please address any concerns raised by review and/or ping us again.
Thank you for all your contributions.

@github-actions github-actions bot added the Stale label Oct 8, 2025
Returning the original version is a common use-case and is not as easy as it should be, particularly because calling `reify` on the first version returns `nil`, which is the `object` *before* it was created.

This method simply tries to `reify` from the *second* version, if it exists. If it doesn’t exist (i.e. there has not been any changes to the object), it falls back to `self`, which is the original and *only* version of the object.

Added specs to document, legacy widget and widget.

Fixes paper-trail-gem#1204.
@joshuapinter
Copy link
Author

Not stale. I just rebased and it's ready for review and to be merged if all good. Anybody...?

@github-actions github-actions bot removed the Stale label Oct 11, 2025
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

Successfully merging this pull request may close these issues.

Add original_version method to more easily obtain the original version.

2 participants