Skip to content

Commit

Permalink
optimise taglocations API (publiclab#10028)
Browse files Browse the repository at this point in the history
  • Loading branch information
17sushmita authored and billymoroney1 committed Dec 28, 2021
1 parent 3beb9a8 commit f797d52
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/services/search_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,7 @@ def tagNearbyNodes(coordinates, tag, period = { "from" => nil, "to" => nil }, so
.where('created BETWEEN ' + period["from"].to_s + ' AND ' + period["to"].to_s)

# selects the items whose node_tags don't have the location:blurred tag
items.select do |item|
item.node_tags.none? do |node_tag|
node_tag.name == "location:blurred"
end
end
items.joins(:term_data).where('term_data.name <> "location:blurred"')

# sort nodes by recent activities if the sort_by==recent
if sort_by == "recent"
Expand Down

0 comments on commit f797d52

Please sign in to comment.