Skip to content

Commit

Permalink
Map existing canonical tag search param to wrangling_status
Browse files Browse the repository at this point in the history
  • Loading branch information
metallicity committed Feb 24, 2025
1 parent 0db10f1 commit d0128dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ def tag_search_params
:name,
:fandoms,
:type,
:canonical,
:wrangling_status,
:created_at,
:uses,
Expand Down
8 changes: 8 additions & 0 deletions app/models/search/tag_search_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class TagSearchForm
ATTRIBUTES = [
:query,
:name,
:canonical,
:wrangling_status,
:fandoms,
:type,
Expand All @@ -25,6 +26,7 @@ class TagSearchForm
def initialize(options={})
@options = options
set_fandoms
set_wrangling_status
@searcher = TagQuery.new(@options.delete_if { |_, v| v.blank? })
end

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

def set_wrangling_status
return unless @options[:canonical]

@options[:wrangling_status] = "canonical"
end

def sort_columns
options[:sort_column] || "name"
end
Expand Down

0 comments on commit d0128dc

Please sign in to comment.