Skip to content
Snippets Groups Projects
Commit ce05e7de authored by ArtOfCode-'s avatar ArtOfCode-
Browse files

Missed a bit

parent 2246883e
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ class TagsController < ApplicationController
@tags = if params[:q].present?
@tag.children.search(params[:q])
elsif params[:hierarchical].present?
@tag_set.tags_with_paths.order(:path)
@tag.children_with_paths.order(:path)
else
@tag.children.order(Arel.sql('COUNT(posts.id) DESC'))
end
......
......@@ -3,6 +3,7 @@ class Tag < ApplicationRecord
has_and_belongs_to_many :posts
has_many :children, class_name: 'Tag', foreign_key: :parent_id
has_many :children_with_paths, class_name: 'TagWithPath', foreign_key: :parent_id
belongs_to :tag_set
belongs_to :parent, class_name: 'Tag', optional: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment