Skip to content

Commit f797d52

Browse files
17sushmitabillymoroney1
authored andcommitted
optimise taglocations API (publiclab#10028)
1 parent 3beb9a8 commit f797d52

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

app/services/search_service.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,7 @@ def tagNearbyNodes(coordinates, tag, period = { "from" => nil, "to" => nil }, so
145145
.where('created BETWEEN ' + period["from"].to_s + ' AND ' + period["to"].to_s)
146146

147147
# selects the items whose node_tags don't have the location:blurred tag
148-
items.select do |item|
149-
item.node_tags.none? do |node_tag|
150-
node_tag.name == "location:blurred"
151-
end
152-
end
148+
items.joins(:term_data).where('term_data.name <> "location:blurred"')
153149

154150
# sort nodes by recent activities if the sort_by==recent
155151
if sort_by == "recent"

0 commit comments

Comments
 (0)