class CConfig::Railtie

This class will set up this gem for Ruby on Rails:

- On initialization this Railtie will set the `APP_CONFIG` global
  constant with the resulting merged values of the configuration.
- The `cconfig:info` rake task will be loaded.

Constants

APP_CONFIG

Public Class Methods

fetch_prefix(app) click to toggle source

fetch_prefix returns a string containing the prefix to be used by our CConfig::Config instance.

app contains the Rails application as given by the railtie API.

# File lib/cconfig/railtie.rb, line 51
def self.fetch_prefix(app)
  if ENV["CCONFIG_PREFIX"].present?
    ENV["CCONFIG_PREFIX"]
  elsif Rails::VERSION::MAJOR >= 6
    app.class.module_parent_name.inspect
  else
    app.class.parent_name.inspect
  end
end