Skip to content

Commit

Permalink
Replace deprecated Rails constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jvendetti committed Feb 23, 2015
1 parent 49a4243 commit 893d142
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def self.convert_params(params)
end

def self.local(level, message)
if defined? RAILS_DEFAULT_LOGGER
RAILS_DEFAULT_LOGGER.send(level, message)
if defined? Rails.logger
Rails.logger.send(level, message)
else
p "#{level} || #{message}"
end
Expand Down
6 changes: 3 additions & 3 deletions script/ssl_server
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end
options = {
:Port => 443,
:Host => "0.0.0.0",
:environment => (ENV['RAILS_ENV'] || "development").dup,
:environment => (Rails.env || "development").dup,
:config => Rails.root + "/config.ru",
:detach => false,
:debugger => false,
Expand Down Expand Up @@ -68,8 +68,8 @@ if options[:detach]
at_exit { File.delete(pid) if File.exist?(pid) }
end

ENV["RAILS_ENV"] = options[:environment]
RAILS_ENV.replace(options[:environment]) if defined?(RAILS_ENV)
Rails.env = options[:environment]
Rails.env.replace(options[:environment]) if defined?(Rails.env)

if File.exist?(options[:config])
config = options[:config]
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ENV["RAILS_ENV"] = "test"
Rails.env = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

Expand Down

0 comments on commit 893d142

Please sign in to comment.