From 336cb3c0bf3d38400f6c774ca78376117b899985 Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Thu, 8 Apr 2010 15:52:35 +1000 Subject: Adding Rails.env= to railties to allow changing of rails env on the fly for rake tasks etc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/lib/rails.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'railties/lib/rails.rb') diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index 9d02da104d..085b82c154 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -79,6 +79,10 @@ module Rails @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development") end + def env=(environment) + @_env = ActiveSupport::StringInquirer.new(environment) + end + def cache RAILS_CACHE end -- cgit v1.2.3