DEV: Deprecate Category#url_with_id in favor of Category#url (#9972)

This commit is contained in:
Dan Ungureanu
2020-06-18 11:32:14 +03:00
committed by GitHub
parent 62faa0f5fe
commit d21a08c284
10 changed files with 21 additions and 45 deletions

View File

@@ -41,7 +41,7 @@ module PrettyText
def category_hashtag_lookup(category_slug)
if category = Category.query_from_hashtag_slug(category_slug)
[category.url_with_id, category_slug]
[category.url, category_slug]
else
nil
end
@@ -106,7 +106,7 @@ module PrettyText
is_tag = text =~ /#{tag_postfix}$/
if !is_tag && category = Category.query_from_hashtag_slug(text)
[category.url_with_id, text]
[category.url, text]
elsif (!is_tag && tag = Tag.find_by(name: text)) ||
(is_tag && tag = Tag.find_by(name: text.gsub!("#{tag_postfix}", '')))
["#{Discourse.base_url}/tag/#{tag.name}", text]