]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/search_controller.rb
Fixed error handling in the name search and tidied things up a bit.
[rails.git] / app / controllers / search_controller.rb
index 70bf23824a3e3167cf83d204e1d7a9ce9214c7d5..fc45f315aac828b9411430c80827236e81163e14 100644 (file)
@@ -92,15 +92,14 @@ class SearchController < ApplicationController
     # Fetch any segments needed for our ways (only have matching segments so far)
     seg_ids = Array.new
     ways.each do |way|
     # Fetch any segments needed for our ways (only have matching segments so far)
     seg_ids = Array.new
     ways.each do |way|
-      seg_ids += way.segments
+      seg_ids += way.segs
     end
     segments += Segment.find(seg_ids)
 
     # Fetch any nodes needed for our segments (only have matching nodes so far)
     node_ids = Array.new
     segments.each do |seg|
     end
     segments += Segment.find(seg_ids)
 
     # Fetch any nodes needed for our segments (only have matching nodes so far)
     node_ids = Array.new
     segments.each do |seg|
-      node_ids += seg.node_a
-      node_ids += seg.node_b
+      node_ids += [seg.node_a, seg.node_b]
     end
     nodes += Node.find(node_ids)
 
     end
     nodes += Node.find(node_ids)