- @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 }] )
-
- # Used for edit link, takes approx middle node of way
- @midnode = @way.nodes[@way.nodes.length/2]
+ @next = Way.visible.where("id > ?", @way.id).order("id ASC").first
+ @prev = Way.visible.where("id < ?", @way.id).order("id DESC").first