FIX: Sync client and server side behavior for category hashtag lookup

Category.query_from_hashtag_slug is the only source of truth.
This commit is contained in:
Dan Ungureanu
2020-07-08 21:24:09 +03:00
parent 56f42d89c5
commit e88b17c044
2 changed files with 5 additions and 8 deletions

View File

@@ -10,8 +10,7 @@ class CategoryHashtagsController < ApplicationController
slugs_and_urls = {}
Category.secured(guardian).where(id: ids).order(:id).each do |category|
slugs_and_urls[category.slug] ||= category.url
Category.secured(guardian).where(id: ids).each do |category|
slugs_and_urls[category.slug_path.last(2).join(':')] ||= category.url
end