Commit 372d9541 authored by Matthias Käppler's avatar Matthias Käppler

Merge branch 'rz-move-rails-settings-override' into 'master'

Move override_rails_constants.rb to another location

See merge request gitlab-org/gitlab!75862
parents 44b8e35b fceb929f
......@@ -3,12 +3,12 @@
require 'active_support/environment_inquirer'
module Rails # rubocop:disable Gitlab/NamespacedClass
module Rails
extend self
def env
@env ||= ActiveSupport::EnvironmentInquirer.new(
ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "test"
ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development"
)
end
......
......@@ -7,7 +7,7 @@
# to all necessary constants. For example, we need Rails.root to
# determine the location of bin/metrics-server.
# Here we make the necessary constants available conditionally.
require_relative '../scripts/override_rails_constants' unless Object.const_defined?('Rails')
require_relative 'override_rails_constants' unless Object.const_defined?('Rails')
require_relative '../config/settings'
......
......@@ -13,7 +13,17 @@ require 'active_support/string_inquirer'
ENV['SKIP_RAILS_ENV_IN_RAKE'] = 'true'
require_relative 'override_rails_constants'
module Rails
extend self
def root
Pathname.new(File.expand_path('..', __dir__))
end
def env
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "test")
end
end
ActiveSupport::Dependencies.autoload_paths << 'lib'
......
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