]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/notes_controller.rb
Move browse#note to notes#show
[rails.git] / app / controllers / notes_controller.rb
index 4c1bac1934d8feb6def7cc93790e47fd72696cbd..440a620e8116806be582b4b996a88088cb53a1a7 100644 (file)
@@ -33,5 +33,19 @@ class NotesController < ApplicationController
     end
   end
 
+  def show
+    @type = "note"
+
+    if current_user&.moderator?
+      @note = Note.find(params[:id])
+      @note_comments = @note.comments.unscope(:where => :visible)
+    else
+      @note = Note.visible.find(params[:id])
+      @note_comments = @note.comments
+    end
+  rescue ActiveRecord::RecordNotFound
+    render :template => "browse/not_found", :status => :not_found
+  end
+
   def new; end
 end