X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/3fb931f9a86955faa39bec1fa4f2a731cbc74780..6c51b3cc0ad7e193c7dae3794502088faab37c7b:/app/controllers/browse_controller.rb diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 5526aacca..47d902a30 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -27,7 +27,7 @@ class BrowseController < ApplicationController def way @type = "way" - @way = Way.find(params[:id], :include => [:way_tags, {:changeset => :user}, {:nodes => [:node_tags, {:ways => :way_tags}]}, :containing_relation_members]) + @way = Way.preload(:way_tags, :containing_relation_members, :changeset => :user, :nodes => [:node_tags, :ways => :way_tags]).find(params[:id]) @next = Way.visible.where("id > ?", @way.id).order("id ASC").first @prev = Way.visible.where("id < ?", @way.id).order("id DESC").first rescue ActiveRecord::RecordNotFound @@ -36,7 +36,7 @@ class BrowseController < ApplicationController def way_history @type = "way" - @way = Way.find(params[:id], :include => [:way_tags, {:old_ways => {:changeset => :user}}]) + @way = Way.preload(:way_tags, :old_ways => { :changeset => :user }).find(params[:id]) rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found end @@ -80,6 +80,7 @@ class BrowseController < ApplicationController def note @type = "note" @note = Note.find(params[:id]) + @title = "#{I18n.t('browse.note.title')} | #{@note.id}" @next = Note.find(:first, :order => "id ASC", :conditions => [ "status != 'hidden' AND id > :id", { :id => @note.id }] ) @prev = Note.find(:first, :order => "id DESC", :conditions => [ "status != 'hidden' AND id < :id", { :id => @note.id }] ) rescue ActiveRecord::RecordNotFound