Skip to content

Commit

Permalink
optimise performance of tag_controller show (#8073)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlazypanda authored Jun 24, 2020
1 parent 95906a0 commit 57fc3be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/tag_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def show
nodes = nodes.where(created: @start.to_i..@end.to_i)
else
@pinned_nodes = NodeShared.pinned_nodes(params[:id])
if @pinned_nodes.length > 0 && params[:page].nil? # i.e. first page
if @pinned_nodes.size.positive? && params[:page].nil? # i.e. first page
nodes = nodes.where.not(nid: @pinned_nodes.collect(&:id))
end
end
Expand Down

0 comments on commit 57fc3be

Please sign in to comment.