Skip to content

Commit

Permalink
don't use deprecated RAILS_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Feb 5, 2010
1 parent aca3794 commit 66b76df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/will_paginate/deprecation.rb
Expand Up @@ -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|
Expand All @@ -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
Expand Down

0 comments on commit 66b76df

Please sign in to comment.