return 404 when record not found

This commit is contained in:
Nihad Abbasov 2012-07-05 08:12:09 -07:00
parent f086676b7c
commit efa21573df
1 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,10 @@ module Gitlab
VERSION = 'v2'
version VERSION, :using => :path
rescue_from ActiveRecord::RecordNotFound do
rack_response({'message' => '404 Not found'}.to_json, 404)
end
format :json
error_format :json
helpers APIHelpers