2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

Merge pull request #3956 from tgxworld/fix_clashing_slug

FIX: Clashing category slug.
This commit is contained in:
Guo Xiang Tan 2016-01-18 10:15:13 +08:00
commit a055c37939
10 changed files with 65 additions and 14 deletions

View file

@ -49,9 +49,8 @@ module PrettyText
end
def category_hashtag_lookup(category_slug)
if category_slug
category = Category.find_by_slug(category_slug)
return ['category', category.url_with_id] if category
if category = Category.query_from_hashtag_slug(category_slug)
['category', category.url_with_id]
else
nil
end