diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-05-10 22:06:02 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-05-10 22:06:02 +0300 |
commit | 93ca5c9964a26fbf31fcc794348b30193f4dff9f (patch) | |
tree | a791983d66b86d5f92fc00c08b2941595c2cc0d7 /lib/api | |
parent | e56e3cdc62f96541b9bd8b7814204e92f1909253 (diff) |
Fix notes API calls symbol convertions
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/notes.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb index 4ac08a3e8c4..f0116acd90f 100644 --- a/lib/api/notes.rb +++ b/lib/api/notes.rb @@ -19,7 +19,7 @@ module API # GET /projects/:id/issues/:noteable_id/notes # GET /projects/:id/snippets/:noteable_id/notes get ":id/#{noteables_str}/:#{noteable_id_str}/notes" do - @noteable = user_project.send(:"#{noteables_str}").find(params[:"#{noteable_id_str}"]) + @noteable = user_project.send(noteables_str.to_sym).find(params[noteable_id_str.to_sym]) read_ability_name = "read_#{@noteable.class.to_s.underscore.downcase}".to_sym if can?(current_user, read_ability_name, @noteable) @@ -36,7 +36,7 @@ module API reject { |n| n.cross_reference_not_visible_for?(current_user) } present notes, with: Entities::Note else - render_api_error!("Not found.", 404) + not_found!("Notes") end end @@ -50,7 +50,7 @@ module API # GET /projects/:id/issues/:noteable_id/notes/:note_id # GET /projects/:id/snippets/:noteable_id/notes/:note_id get ":id/#{noteables_str}/:#{noteable_id_str}/notes/:note_id" do - @noteable = user_project.send(:"#{noteables_str}").find(params[:"#{noteable_id_str}"]) + @noteable = user_project.send(noteables_str.to_sym).find(params[noteable_id_str.to_sym]) @note = @noteable.notes.find(params[:note_id]) if @note.cross_reference_not_visible_for?(current_user) |