Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-07-06 16:19:14 +0300
committerJames Lopez <james@jameslopez.es>2017-07-06 16:27:49 +0300
commit2aa95aa0185c94aefd6e51a35c62650d75d3c8b6 (patch)
treeb1f7811bab8da709de2f5d6f26fb6c47e1840813 /lib/api/snippets.rb
parent47e17fe12ad009656f0b20469f930d1aa0e742e6 (diff)
refactor code based on feedback
Diffstat (limited to 'lib/api/snippets.rb')
-rw-r--r--lib/api/snippets.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/api/snippets.rb b/lib/api/snippets.rb
index db4e0b0b013..fd634037a77 100644
--- a/lib/api/snippets.rb
+++ b/lib/api/snippets.rb
@@ -150,9 +150,8 @@ module API
get ":id/user_agent_detail" do
authenticated_as_admin!
- snippet = Snippet.find_by(id: params[:id])
+ snippet = Snippet.find_by!(id: params[:id])
- return not_found!('Snippet') unless snippet
return not_found!('UserAgentDetail') unless snippet.user_agent_detail
present snippet.user_agent_detail, with: Entities::UserAgentDetail