instance method
load_environment
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available 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 332
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 332
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Rails::Initializer