Commit 968c09ae919ce745a158764d49b3aff280324eb5
1 parent
c177593e
Exists in
master
and in
4 other branches
API version returns last version set
* fixed in grape v0.2.2
Showing
2 changed files
with
2 additions
and
3 deletions
Show diff stats
lib/api.rb
| ... | ... | @@ -2,8 +2,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file} |
| 2 | 2 | |
| 3 | 3 | module Gitlab |
| 4 | 4 | class API < Grape::API |
| 5 | - VERSION = 'v2' | |
| 6 | - version VERSION, using: :path | |
| 5 | + version 'v2', using: :path | |
| 7 | 6 | |
| 8 | 7 | rescue_from ActiveRecord::RecordNotFound do |
| 9 | 8 | rack_response({'message' => '404 Not found'}.to_json, 404) | ... | ... |
spec/support/api_helpers.rb
| ... | ... | @@ -18,7 +18,7 @@ module ApiHelpers |
| 18 | 18 | # |
| 19 | 19 | # Returns the relative path to the requested API resource |
| 20 | 20 | def api(path, user = nil) |
| 21 | - "/api/#{Gitlab::API::VERSION}#{path}" + | |
| 21 | + "/api/#{Gitlab::API.version}#{path}" + | |
| 22 | 22 | |
| 23 | 23 | # Normalize query string |
| 24 | 24 | (path.index('?') ? '' : '?') + | ... | ... |