]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Fixed some minor bugs and add tests to spot them
[rails.git] / app / controllers / browse_controller.rb
index a77b0f94a48f71939e16243282e27735bd0f9ac2..cb866eb3f9e41089dd0e1b1c2f50af479c3efbc0 100644 (file)
@@ -78,6 +78,15 @@ class BrowseController < ApplicationController
     render :action => "not_found", :status => :not_found
   end
 
+  def bug
+    @type = "bug"
+    @bug = MapBug.find(params[:id])
+    @next = MapBug.find(:first, :order => "id ASC", :conditions => [ "status != 'hidden' AND id > :id", { :id => @bug.id }] )
+    @prev = MapBug.find(:first, :order => "id DESC", :conditions => [ "status != 'hidden' AND id < :id", { :id => @bug.id }] )
+  rescue ActiveRecord::RecordNotFound
+    render :action => "not_found", :status => :not_found
+  end
+
 private
 
   def timeout