Pass parameters to APIAlreadyDeletedError correctly
This commit is contained in:
parent
c12fe5f6e8
commit
6279d83260
1 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue