]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/way_controller.rb
Use SecureRandom instead of the deprecated ActiveSupport::SecureRandom
[rails.git] / app / controllers / way_controller.rb
index f2cda21bca0da9e77938daca4a7e6f33d349c167..e20eb1a7970c2942176d4302ecd987fc0b652ff1 100644 (file)
@@ -25,7 +25,7 @@ class WayController < ApplicationController
   def read
     way = Way.find(params[:id])
     
-    response.headers['Last-Modified'] = way.timestamp.rfc822
+    response.last_modified = way.timestamp
     
     if way.visible
       render :text => way.to_xml.to_s, :content_type => "text/xml"
@@ -60,7 +60,7 @@ class WayController < ApplicationController
   end
 
   def full
-    way = Way.find(params[:id], :include => {:nodes => :node_tags})
+    way = Way.includes(:nodes => :node_tags).find(params[:id])
     
     if way.visible
       changeset_cache = {}
@@ -105,9 +105,7 @@ class WayController < ApplicationController
   # :id parameter. note that this used to return deleted ways as well, but
   # this seemed not to be the expected behaviour, so it was removed.
   def ways_for_node
-    wayids = WayNode.find(:all, 
-                          :conditions => ['node_id = ?', params[:id]]
-                          ).collect { |ws| ws.id[0] }.uniq
+    wayids = WayNode.where(:node_id => params[:id]).collect { |ws| ws.id[0] }.uniq
 
     doc = OSM::API.new.get_xml_doc