Skip to content

Commit

Permalink
invert if/else #11447 (#11449)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesar-codes authored Sep 30, 2022
1 parent df34af2 commit f060bd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/questions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ def filter_questions_by_tag(questions, tagnames)
.joins(:tag)
.where('node.nid IN (?)', nids)
.group('node.nid')
if !tagnames.empty?
questions.where('term_data.name IN (?)', tagnames)
else
if tagnames.empty?
questions
else
questions.where('term_data.name IN (?)', tagnames)
end
end

Expand Down

0 comments on commit f060bd2

Please sign in to comment.