Skip to content
代码片段 群组 项目
override_rails_constants.rb 398 字节
更新 更旧
# rubocop:disable Naming/FileName
# frozen_string_literal: true

require 'active_support/environment_inquirer'

  extend self

  def env
    @env ||= ActiveSupport::EnvironmentInquirer.new(
      ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development"
    )
  end

  def root
    Pathname.new(File.expand_path('..', __dir__))
  end
end

# rubocop:enable Naming/FileName