Skip to content

Commit d0128dc

Browse files
committed
Map existing canonical tag search param to wrangling_status
1 parent 0db10f1 commit d0128dc

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

app/controllers/tags_controller.rb

+1
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ def tag_search_params
419419
:name,
420420
:fandoms,
421421
:type,
422+
:canonical,
422423
:wrangling_status,
423424
:created_at,
424425
:uses,

app/models/search/tag_search_form.rb

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class TagSearchForm
77
ATTRIBUTES = [
88
:query,
99
:name,
10+
:canonical,
1011
:wrangling_status,
1112
:fandoms,
1213
:type,
@@ -25,6 +26,7 @@ class TagSearchForm
2526
def initialize(options={})
2627
@options = options
2728
set_fandoms
29+
set_wrangling_status
2830
@searcher = TagQuery.new(@options.delete_if { |_, v| v.blank? })
2931
end
3032

@@ -43,6 +45,12 @@ def set_fandoms
4345
@options[:fandom_ids] = Tag.where(name: names).pluck(:id)
4446
end
4547

48+
def set_wrangling_status
49+
return unless @options[:canonical]
50+
51+
@options[:wrangling_status] = "canonical"
52+
end
53+
4654
def sort_columns
4755
options[:sort_column] || "name"
4856
end

0 commit comments

Comments
 (0)