Commit 968c09ae919ce745a158764d49b3aff280324eb5

Authored by Nihad Abbasov
1 parent c177593e

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
@@ -2,8 +2,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file} @@ -2,8 +2,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file}
2 2
3 module Gitlab 3 module Gitlab
4 class API < Grape::API 4 class API < Grape::API
5 - VERSION = 'v2'  
6 - version VERSION, using: :path 5 + version 'v2', using: :path
7 6
8 rescue_from ActiveRecord::RecordNotFound do 7 rescue_from ActiveRecord::RecordNotFound do
9 rack_response({'message' => '404 Not found'}.to_json, 404) 8 rack_response({'message' => '404 Not found'}.to_json, 404)
spec/support/api_helpers.rb
@@ -18,7 +18,7 @@ module ApiHelpers @@ -18,7 +18,7 @@ module ApiHelpers
18 # 18 #
19 # Returns the relative path to the requested API resource 19 # Returns the relative path to the requested API resource
20 def api(path, user = nil) 20 def api(path, user = nil)
21 - "/api/#{Gitlab::API::VERSION}#{path}" + 21 + "/api/#{Gitlab::API.version}#{path}" +
22 22
23 # Normalize query string 23 # Normalize query string
24 (path.index('?') ? '' : '?') + 24 (path.index('?') ? '' : '?') +