Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Pass parameters to APIAlreadyDeletedError correctly

  • Loading branch information...
commit 6279d83260cd9a03395a73f1c3df66ffe4c9486d 1 parent c12fe5f
@tomhughes authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 app/controllers/notes_controller.rb
View
10 app/controllers/notes_controller.rb
@@ -93,7 +93,7 @@ def comment
# 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 @@ def close
# 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 @@ def show
# 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 @@ def destroy
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.