dtext links: add search options for finding broken links.
Add "Wiki Exists?" and "Tag Exists?" options to /dtext_links. These can be used to find links to wikis or tags that don't exist (broken links).
This commit is contained in:
@@ -52,6 +52,10 @@ class WikiPage < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def tag_matches(params)
|
||||
where(title: Tag.search(params).select(:name).reorder(nil))
|
||||
end
|
||||
|
||||
def default_order
|
||||
order(updated_at: :desc)
|
||||
end
|
||||
@@ -70,6 +74,10 @@ class WikiPage < ApplicationRecord
|
||||
q = q.other_names_match(params[:other_names_match])
|
||||
end
|
||||
|
||||
if params[:tag].present?
|
||||
q = q.tag_matches(params[:tag])
|
||||
end
|
||||
|
||||
if params[:hide_deleted].to_s.truthy?
|
||||
q = q.where("is_deleted = false")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user