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

Document the real meaning of checkout#set_state_if_present #3406

Merged
merged 1 commit into from
Oct 30, 2019

Conversation

elia
Copy link
Member

@elia elia commented Oct 25, 2019

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:

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.
Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elia thank you 👍

Copy link
Member

@kennyadsl kennyadsl left a 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
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#3496

@kennyadsl kennyadsl changed the title Document the real meaning of checkout#set_stat_if_present Document the real meaning of checkout#set_state_if_present Oct 30, 2019
@kennyadsl kennyadsl merged commit a11f627 into solidusio:master Oct 30, 2019
@kennyadsl kennyadsl deleted the elia/doc-set_state_if_present branch October 30, 2019 11:59
elia added a commit to nebulab/solidus that referenced this pull request Jan 29, 2020
The original name was quite detached from what the method is doing.

Ref: solidusio#3406 (comment)
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.

None yet

3 participants