]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Optimise data loading for browsing ways.
[rails.git] / app / controllers / browse_controller.rb
index e9081f02698911a8e01e5a2bd516d6ae9135cda9..d8399c19e4af410dd3c7f135c9d133054aa12395 100644 (file)
@@ -26,7 +26,7 @@ class BrowseController < ApplicationController
   end
   
   def way
-    @way = Way.find(params[:id])
+    @way = Way.find(params[:id], :include => [:way_tags, {:changeset => :user}, {:nodes => [:node_tags, {:ways => :way_tags}]}, :containing_relation_members])
     @next = Way.find(:first, :order => "id ASC", :conditions => [ "visible = true AND id > :id", { :id => @way.id }] )
     @prev = Way.find(:first, :order => "id DESC", :conditions => [ "visible = true AND id < :id", { :id => @way.id }] )
   rescue ActiveRecord::RecordNotFound
@@ -35,7 +35,7 @@ class BrowseController < ApplicationController
   end
   
   def way_history
-    @way = Way.find(params[:id])
+    @way = Way.find(params[:id], :include => [:way_tags, {:old_ways => {:changeset => :user}}])
   rescue ActiveRecord::RecordNotFound
     @type = "way"
     render :action => "not_found", :status => :not_found