Skip to content

Commit 88c52b4

Browse files
committed
minor cleanup of tags controller's index action
1 parent 74c1416 commit 88c52b4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

app/controllers/tags_controller.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ def index
1010
@tag_set = if params[:tag_set].present?
1111
TagSet.find(params[:tag_set])
1212
end
13+
1314
@tags = if params[:term].present?
1415
(@tag_set&.tags || Tag).search(params[:term])
1516
else
1617
(@tag_set&.tags || Tag.all).order(:name)
17-
end.includes(:tag_synonyms).paginate(page: params[:page], per_page: 50)
18+
end
19+
20+
@tags = @tags.includes(:tag_synonyms)
21+
.paginate(page: params[:page], per_page: 50)
22+
1823
respond_to do |format|
1924
format.json do
2025
render json: @tags.to_json(include: { tag_synonyms: { only: :name } })

0 commit comments

Comments
 (0)