instance method load_environment

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

load_environment()

Loads the environment specified by Configuration#environment_path, which is typically one of development, test, or production.

Source
# File railties/lib/initializer.rb, line 378
    def load_environment
      silence_warnings do
        return if @environment_loaded
        @environment_loaded = true

        config = configuration
        constants = self.class.constants

        eval(IO.read(configuration.environment_path), binding, configuration.environment_path)

        (self.class.constants - constants).each do |const|
          Object.const_set(const, self.class.const_get(const))
        end
      end
    end

Defined in railties/lib/initializer.rb line 378 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Initializer

Type at least 2 characters to search.

↑↓ navigate · open · esc close