Merge branch '15964-fix-docs' refs #15964
[arvados.git] / services / api / config / initializers / legacy_jobs_api.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 # Config must be done before we  files; otherwise they
6 # won't be able to use Rails.configuration.* to initialize their
7 # classes.
8
9 require 'enable_jobs_api'
10
11 Rails.application.configure do
12   begin
13     if ActiveRecord::Base.connection.tables.include?('jobs')
14       check_enable_legacy_jobs_api
15     end
16   rescue ActiveRecord::NoDatabaseError
17     # Since rails 5.2, all initializers are run by rake tasks (like db:create),
18     # see: https://github.com/rails/rails/issues/32870
19   end
20 end