Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qpixel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Answers
Qpixel
Commits
ce05e7de
Commit
ce05e7de
authored
Jul 1, 2020
by
ArtOfCode-
Browse files
Options
Downloads
Patches
Plain Diff
Missed a bit
parent
2246883e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/tags_controller.rb
+1
-1
1 addition, 1 deletion
app/controllers/tags_controller.rb
app/models/tag.rb
+1
-0
1 addition, 0 deletions
app/models/tag.rb
with
2 additions
and
1 deletion
app/controllers/tags_controller.rb
+
1
−
1
View file @
ce05e7de
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
app/models/tag.rb
+
1
−
0
View file @
ce05e7de
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment