diff options
Diffstat (limited to 'railties/lib/rails.rb')
-rw-r--r-- | railties/lib/rails.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index 9d02da104d..0611b2a9f5 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 @@ -88,11 +92,12 @@ module Rails end def public_path - @@public_path ||= self.root ? File.join(self.root, "public") : "public" + application && application.paths.public.to_a.first end def public_path=(path) - @@public_path = path + ActiveSupport::Deprecation.warn "Setting Rails.public_path= is deprecated. " << + "Please set paths.public = in config/application.rb instead.", caller end end end |