require_relative 'load_config.rb'
Server::Application.configure do
+ # Use exec_query because the Job model isn't loaded yet
+ # it returns the string '0', not converted to integer.
if Rails.configuration.enable_legacy_jobs_api == false ||
(Rails.configuration.enable_legacy_jobs_api == "auto" &&
- ActiveRecord::Base.connection.exec_query("select count(*) from jobs")[0] == 0)
+ ActiveRecord::Base.connection.exec_query('select count(*) from jobs').first['count'] == '0')
Rails.configuration.disable_api_methods = ["jobs.create",
"pipeline_instances.create",
"pipeline_templates.create",