Commit 0a280158 authored by Timothy Andrew's avatar Timothy Andrew Committed by Kamil Trzcinski

Eager load `lib/api`

- So that the server doesn't have to be restarted for every change in dev.
parent 5fc310b4
......@@ -79,6 +79,8 @@ module Gitlab
# This is needed for gitlab-shell
ENV['GITLAB_PATH_OUTSIDE_HOOK'] = ENV['PATH']
config.eager_load_paths += ["#{Rails.root}/lib"]
config.generators do |g|
g.factory_girl false
end
......
require 'sidekiq/web'
require 'sidekiq/cron/web'
require 'api/api'
Rails.application.routes.draw do
if Gitlab::Sherlock.enabled?
......
Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file}
module API
class API < Grape::API
include APIGuard
include ::API::APIGuard
version 'v3', using: :path
rescue_from ActiveRecord::RecordNotFound do
......
......@@ -2,7 +2,8 @@
require 'rack/oauth2'
module APIGuard
module API
module APIGuard
extend ActiveSupport::Concern
included do |base|
......@@ -169,4 +170,5 @@ module APIGuard
@scopes = scopes
end
end
end
end
\ No newline at end of file
......@@ -3,7 +3,7 @@ Dir["#{Rails.root}/lib/ci/api/*.rb"].each {|file| require file}
module Ci
module API
class API < Grape::API
include APIGuard
include ::API::APIGuard
version 'v1', using: :path
rescue_from ActiveRecord::RecordNotFound do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment