Skip to content

Commit b08b2d2

Browse files
committed
Match existing behavior for canonical 'T' and 'F'
1 parent d0128dc commit b08b2d2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

app/models/search/tag_search_form.rb

+11-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,19 @@ def set_fandoms
4545
@options[:fandom_ids] = Tag.where(name: names).pluck(:id)
4646
end
4747

48+
def bool_value(str)
49+
%w(true 1 T).include?(str.to_s)
50+
end
51+
4852
def set_wrangling_status
49-
return unless @options[:canonical]
53+
return if @options[:canonical].blank?
5054

51-
@options[:wrangling_status] = "canonical"
55+
# Match old behavior for canonical param
56+
if bool_value(@options[:canonical])
57+
@options[:wrangling_status] = "canonical"
58+
else
59+
@options[:wrangling_status] = "noncanonical"
60+
end
5261
end
5362

5463
def sort_columns

0 commit comments

Comments
 (0)