Flowdock
method

environment

Importance_1
Ruby on Rails latest stable (v4.0.2) - 1 note - Class: Rails::Configuration

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.

These similar methods exist in v4.0.2:

environment() public

Return the currently selected environment. By default, it returns the value of the RAILS_ENV constant.

Show source
Register or log in to add new notes.
July 24, 2008 - (v1.0.0 - v2.1.0)
1 thank

Custom environment constants

Custom environment level constants can be passed in to your rails application (server, console, whatever) like this):

# bash, tcsh, whatever shell
GAMEMODE=pregame script/server

Within rails this constant can be accessed by

ENV['GAMEMODE']
=> "pregame"

ENV['DOES-NOT-EXIST']
=> nil