Permalink
Browse files

don't use deprecated RAILS_ENV

  • Loading branch information...
1 parent aca3794 commit 66b76dfbd740c45b7e78fa80f8626a52df7ae021 @mislav committed Feb 5, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/will_paginate/deprecation.rb
@@ -5,7 +5,7 @@ def self.debug() @debug; end
def self.debug=(value) @debug = value; end
self.debug = false
- # Choose the default warn behavior according to RAILS_ENV.
+ # Choose the default warn behavior according to Rails.env.
# Ignore deprecation warnings in production.
BEHAVIORS = {
'test' => Proc.new { |message, callstack|
@@ -27,8 +27,8 @@ def self.warn(message, callstack = caller)
end
def self.default_behavior
- if defined?(RAILS_ENV)
- BEHAVIORS[RAILS_ENV.to_s]
+ if defined?(::Rails)
+ BEHAVIORS[::Rails.env.to_s]
else
BEHAVIORS['test']
end

0 comments on commit 66b76df

Please sign in to comment.