Add docs for Rails.env
and Rails.env=
[ci skip]
This commit is contained in:
parent
0222cefc40
commit
a770d7e404
@ -56,10 +56,18 @@ def root
|
||||
application && application.config.root
|
||||
end
|
||||
|
||||
# Returns the current Rails environment.
|
||||
#
|
||||
# Rails.env # => "development"
|
||||
# Rails.env.development? # => true
|
||||
# Rails.env.production? # => false
|
||||
def env
|
||||
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development")
|
||||
end
|
||||
|
||||
# Sets the Rails environment.
|
||||
#
|
||||
# Rails.env = "staging" # => "staging"
|
||||
def env=(environment)
|
||||
@_env = ActiveSupport::StringInquirer.new(environment)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user