solidusio / solidus_frontend

BSD 3-Clause "New" or "Revised" License
2 stars 7 forks source link

Utilize Rails redirect methods #9

Closed cpfergus1 closed 2 years ago

cpfergus1 commented 2 years ago

Description

Removes #redirect_back_or_default in favor of Rails #redirect_back and #redirect_back_or_to

Motivation and Context

Rails introduced redirect_back in rails 5+ and redirect_back_or_to in rails 7+. These methods should be utilized instead of the redirect method created by Soldius, which similarly replicates the functionality of the deprecated method. The method #redirect_back_or_default will be deprecated in Solidus PR #4533

How Has This Been Tested?

The current test suite covers the changes made in the PR

Types of changes

Checklist:

waiting-for-dev commented 2 years ago

Thanks, @cpfergus1. The change is perfectly legit, but I'm not sure we want to merge changes into the deprecated frontend. cc @kennyadsl @aldesantis

waiting-for-dev commented 2 years ago

We decided that we're going to keep merging changes until the gem is no longer part of the solidus meta-gem. So, we'll merge this one once the extensions are compatible.

cpfergus1 commented 2 years ago

Unlike the starter_frontend gem, this extension does not require solidus_auth_devise except for the sandbox - The updated methods will not be compatible unless solidus_auth_devise is included. When are we expecting to remove this extension from the solidus meta-gem? We may just want to continue to leave it untouched.

waiting-for-dev commented 2 years ago

Hey @cpfergus1, as the only occurrence here has nothing to do with the sign-in process, can't we use Rails' redirect_back/redirect_back_or_to here?

cpfergus1 commented 2 years ago

Hey @cpfergus1, as the only occurrence here has nothing to do with the sign-in process, can't we use Rails' redirect_back/redirect_back_or_to here?

Yes, it appears to work fine for this location. Thanks for pointing that out!