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
|
# Find the note and check it is valid
|
||||||
@note = Note.find(id)
|
@note = Note.find(id)
|
||||||
raise OSM::APINotFoundError unless @note
|
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
|
# Add a comment to the note
|
||||||
Note.transaction do
|
Note.transaction do
|
||||||
|
@ -120,7 +120,7 @@ class NotesController < ApplicationController
|
||||||
# Find the note and check it is valid
|
# Find the note and check it is valid
|
||||||
@note = Note.find_by_id(id)
|
@note = Note.find_by_id(id)
|
||||||
raise OSM::APINotFoundError unless @note
|
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
|
# Close the note and add a comment
|
||||||
Note.transaction do
|
Note.transaction do
|
||||||
|
@ -170,8 +170,8 @@ class NotesController < ApplicationController
|
||||||
# Find the note and check it is valid
|
# Find the note and check it is valid
|
||||||
@note = Note.find(params[:id])
|
@note = Note.find(params[:id])
|
||||||
raise OSM::APINotFoundError unless @note
|
raise OSM::APINotFoundError unless @note
|
||||||
raise OSM::APIAlreadyDeletedError unless @note.visible?
|
raise OSM::APIAlreadyDeletedError.new("note", @note.id) unless @note.visible?
|
||||||
|
|
||||||
# Render the result
|
# Render the result
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.xml
|
format.xml
|
||||||
|
@ -193,7 +193,7 @@ class NotesController < ApplicationController
|
||||||
# Find the note and check it is valid
|
# Find the note and check it is valid
|
||||||
note = Note.find(id)
|
note = Note.find(id)
|
||||||
raise OSM::APINotFoundError unless note
|
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
|
# Mark the note as hidden
|
||||||
Note.transaction do
|
Note.transaction do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue