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. |
50a3b7a to
26287c4
Compare
|
Not stale. I just rebased and it's ready for review and to be merged if all good. Anybody...? |
|
This PR has been automatically marked as stale due to inactivity. |
|
Not Stale. @fatkodima Can we please get this merged in? Tests and everything are done. Working great in our production environment for the last year. Thanks! |
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.
26287c4 to
7af67da
Compare
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.