module RailsEnvLocal::RailsEnv
This module is prepended to Rails module
Public Instance Methods
env()
click to toggle source
Calls superclass method
# File lib/rails_env_local/rails_env.rb, line 4 def env result = super case result when "development" then msg = %[WARNING: environment is incorrectly "development". Early access of Rails.env might be the cause, consider moving `RailsEnvLocal.set_local_environment` up in config/boot.rb] warn(msg) Rails.logger.error(msg) if Rails.logger when "local" msg = %[WARNING: environment name "local" is partly incompatible with dotenv gem, and probably others] warn(msg) Rails.logger.error(msg) if Rails.logger else # If other bad environment names are found add them to the case statement. # Share the knowledge about environment name incompatibility! end result end