-
Notifications
You must be signed in to change notification settings - Fork 909
Add reify_original method.
#1504
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
base: master
Are you sure you want to change the base?
Add reify_original method.
#1504
Conversation
|
This PR has been automatically marked as stale due to inactivity. |
aed329e to
50a3b7a
Compare
|
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. |
|
This PR has been automatically marked as stale due to inactivity. |
|
@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! |
|
This PR has been automatically marked as stale due to inactivity. |
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.
50a3b7a to
26287c4
Compare
|
Not stale. I just rebased and it's ready for review and to be merged if all good. Anybody...? |
Returning the original version is a common use-case and is not as easy as it should be, particularly because calling
reifyon the first version returnsnil, which is theobjectbefore it was created.This method simply tries to
reifyfrom 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 toself, which is the original and only version of the object.Fixes #1204.
Thank you for your contribution!
Check the following boxes:
master(if not - rebase it).code introduces user-observable changes.
and description in grammatically correct, complete sentences.