summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2012-11-29 13:42:22 -0800
committerNihad Abbasov <narkoz.2008@gmail.com>2012-12-01 02:03:51 -0800
commit968c09ae919ce745a158764d49b3aff280324eb5 (patch)
tree825ddf4151a7adab6b2c0729f614f682e2219b1c
parentc177593e2cf282f09934640bd597e6e3c5f32893 (diff)
downloadgitlab-ce-968c09ae919ce745a158764d49b3aff280324eb5.tar.gz
API version returns last version set
* fixed in grape v0.2.2
-rw-r--r--lib/api.rb3
-rw-r--r--spec/support/api_helpers.rb2
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/api.rb b/lib/api.rb
index 99e2074f306..d01d534cf6b 100644
--- a/lib/api.rb
+++ b/lib/api.rb
@@ -2,8 +2,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file}
module Gitlab
class API < Grape::API
- VERSION = 'v2'
- version VERSION, using: :path
+ version 'v2', using: :path
rescue_from ActiveRecord::RecordNotFound do
rack_response({'message' => '404 Not found'}.to_json, 404)
diff --git a/spec/support/api_helpers.rb b/spec/support/api_helpers.rb
index 7d9011971dd..c4514bf38be 100644
--- a/spec/support/api_helpers.rb
+++ b/spec/support/api_helpers.rb
@@ -18,7 +18,7 @@ module ApiHelpers
#
# Returns the relative path to the requested API resource
def api(path, user = nil)
- "/api/#{Gitlab::API::VERSION}#{path}" +
+ "/api/#{Gitlab::API.version}#{path}" +
# Normalize query string
(path.index('?') ? '' : '?') +