Skip to content

Commit

Permalink
Match existing behavior for canonical 'T' and 'F'
Browse files Browse the repository at this point in the history
  • Loading branch information
metallicity committed Feb 25, 2025
1 parent d0128dc commit ea1e9f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/models/search/tag_search_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ def set_fandoms
end

def set_wrangling_status
return unless @options[:canonical]
return unless @options[:canonical].present?

Check warning on line 49 in app/models/search/tag_search_form.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 Use `if @options[:canonical].blank?` instead of `unless @options[:canonical].present?`. Raw Output: app/models/search/tag_search_form.rb:49:12: C: Rails/Blank: Use `if @options[:canonical].blank?` instead of `unless @options[:canonical].present?`.

@options[:wrangling_status] = "canonical"
# Match old behavior for canonical param
if %w(true 1 T).include?(@options[:canonical].to_s)

Check warning on line 52 in app/models/search/tag_search_form.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 Use the return of the conditional for variable assignment and comparison. Raw Output: app/models/search/tag_search_form.rb:52:5: C: Style/ConditionalAssignment: Use the return of the conditional for variable assignment and comparison.

Check warning on line 52 in app/models/search/tag_search_form.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 `%w`-literals should be delimited by `[` and `]`. Raw Output: app/models/search/tag_search_form.rb:52:8: C: Style/PercentLiteralDelimiters: `%w`-literals should be delimited by `[` and `]`.
@options[:wrangling_status] = "canonical"
else
@options[:wrangling_status] = "noncanonical"
end
end

def sort_columns
Expand Down

0 comments on commit ea1e9f6

Please sign in to comment.