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

assign value to a variable and return at the end. #18867

Merged
merged 1 commit into from
Jun 14, 2019

Conversation

h-kataria
Copy link
Contributor

Fixed exp_find_by_token method to return values correctly when finding token within an expression with mixed operators

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1660460

before
before

after
after

@gtanzillo @jrafanie please review

@dclarizio cc

@h-kataria h-kataria force-pushed the mixed_operator_conditions_fix branch 2 times, most recently from a010ff4 to fc3ada3 Compare June 14, 2019 14:11
Fixed `exp_find_by_token` method to return values correctly when finding token within an expression with mixed operators

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1660460
@h-kataria h-kataria force-pushed the mixed_operator_conditions_fix branch from fc3ada3 to 070d143 Compare June 14, 2019 14:19
@miq-bot
Copy link
Member

miq-bot commented Jun 14, 2019

Checked commit h-kataria@070d143 with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 4 offenses detected

spec/lib/miq_expression/subst_mixin_spec.rb

@h-kataria
Copy link
Contributor Author

@bdunne made requested changes

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

Looks great! 👍

@gtanzillo gtanzillo self-assigned this Jun 14, 2019
@jrafanie jrafanie merged commit 0466cd6 into ManageIQ:master Jun 14, 2019
@jrafanie jrafanie added this to the Sprint 114 Ending Jun 24, 2019 milestone Jun 14, 2019
@jrafanie jrafanie assigned jrafanie and unassigned gtanzillo Jun 14, 2019
simaishi pushed a commit that referenced this pull request Jun 14, 2019
assign value to a variable and return at the end.

(cherry picked from commit 0466cd6)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1720753
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit 8e31216c10fe109043267b82e0903ff0a1f2cb94
Author: Joe Rafaniello <jrafanie@users.noreply.github.com>
Date:   Fri Jun 14 10:51:10 2019 -0400

    Merge pull request #18867 from h-kataria/mixed_operator_conditions_fix
    
    assign value to a variable and return at the end.
    
    (cherry picked from commit 0466cd65679de80ca08eda54d6cccb2f6b0d49c9)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1720753

exp.find do |e|
result = exp_find_by_token(e, token) # Look for token
end
result
Copy link
Member

Choose a reason for hiding this comment

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

why not just

result = exp.find { |e| exp_find_by_token(e, token) }

Am I missing something?

@h-kataria h-kataria deleted the mixed_operator_conditions_fix branch April 14, 2020 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants