Simplify embedded check in HomeController#2065
Draft
isikyus wants to merge 1 commit into
Draft
Conversation
Anything that returns false for `.present?` (`nil`, empty strings, or other empty objects) will also return false for `!= "1"`. So there should be no need for the initial check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Anything that returns false for
.present?(nil, empty strings, or other empty objects) will also return false for!= "1". So there should be no need for the initial check.What this PR does
Simplifies the code in the templated HomeController by removing a redundant check.
Since the template code is added to apps built with
shopify_app, it was being checked by our code quality checks (Reek), and raising areek:DuplicateMethodCallwarning forparams[:embedded]. Our Reek is probably a bit overzealous, so that might not be a concern for you.But in this case the extra call isn't doing anything and can safely be removed.
Reviewer's guide to testing
The generated HomeController should work the same way it did before. No changes to functionality.
Things to focus on
I'm not sure there's much to say.
The main things I'd want to confirm are:
Checklist
Before submitting the PR, please consider if any of the following are needed:
CHANGELOG.mdif the changes would impact users.While this isn't a functionality change, it is user-visible due to affecting code generated in users' apps.
UpdateI don't believe this is necessary for such a minor change.README.md, if appropriate.Update any relevant pages inDitto/docs, if necessary.For security fixes, the Disclosure Policy must be followed.This is not a security fix.