From 6279d83260cd9a03395a73f1c3df66ffe4c9486d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 5 Feb 2013 17:43:43 +0000 Subject: [PATCH] Pass parameters to APIAlreadyDeletedError correctly --- app/controllers/notes_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 1f5b990cc..a7fa03ac7 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -93,7 +93,7 @@ class NotesController < ApplicationController # Find the note and check it is valid @note = Note.find(id) raise OSM::APINotFoundError unless @note - raise OSM::APIAlreadyDeletedError unless @note.visible? + raise OSM::APIAlreadyDeletedError.new("note", @note.id) unless @note.visible? # Add a comment to the note Note.transaction do @@ -120,7 +120,7 @@ class NotesController < ApplicationController # Find the note and check it is valid @note = Note.find_by_id(id) raise OSM::APINotFoundError unless @note - raise OSM::APIAlreadyDeletedError unless @note.visible? + raise OSM::APIAlreadyDeletedError.new("note", @note.id) unless @note.visible? # Close the note and add a comment Note.transaction do @@ -170,8 +170,8 @@ class NotesController < ApplicationController # Find the note and check it is valid @note = Note.find(params[:id]) raise OSM::APINotFoundError unless @note - raise OSM::APIAlreadyDeletedError unless @note.visible? - + raise OSM::APIAlreadyDeletedError.new("note", @note.id) unless @note.visible? + # Render the result respond_to do |format| format.xml @@ -193,7 +193,7 @@ class NotesController < ApplicationController # Find the note and check it is valid note = Note.find(id) raise OSM::APINotFoundError unless note - raise OSM::APIAlreadyDeletedError unless note.visible? + raise OSM::APIAlreadyDeletedError.new("note", note.id) unless note.visible? # Mark the note as hidden Note.transaction do -- 2.43.2