-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Document the real meaning of checkout#set_state_if_present #3406
Document the real meaning of checkout#set_state_if_present #3406
Conversation
The fact that is intended to stop customers from skipping ahead is not easily drawn out by the method name or the contents. Renaming & refactoring both have risks, so, for now, I'll content myself with a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elia thank you 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, left another possible further improvement. Let me know your thoughts. 🙂
# Allow the customer to only go back or stay on the current state | ||
# when trying to change it via params[:state]. It's not allowed to | ||
# jump forward and skip states (unless #skip_state_validation? is | ||
# truthy). | ||
def set_state_if_present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about also changing this method name? We could keep this one so that it only prints the deprecation message and call the new one, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be very much in favor of doing so! I'll make a note to do another PR with the full deprecation work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3496 ✨
The original name was quite detached from what the method is doing. Ref: solidusio#3406 (comment)
Description
The fact that this method intended to stop customers from skipping ahead is not
easily drawn out by the method name or the contents.
Renaming & refactoring both have risks, so, for now, I'll content
myself with a comment.
Checklist: