Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed deprecated (by ActiveSupport 4.1.0) string terminators

  • Loading branch information...
commit 3ac6574c6626ee80897e522260f8805374664d39 1 parent abc0997
@christophemaximin christophemaximin authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/authlogic/session/callbacks.rb
View
9 lib/authlogic/session/callbacks.rb
@@ -63,8 +63,13 @@ module Callbacks
def self.included(base) #:nodoc:
base.send :include, ActiveSupport::Callbacks
- base.define_callbacks *METHODS + [{:terminator => 'result == false'}]
- base.define_callbacks *['persist', {:terminator => 'result == true'}]
+ if ActiveSupport::VERSION::STRING >= '4.1'
+ base.define_callbacks *METHODS + [{:terminator => ->(target, result){ result == false } }]
+ base.define_callbacks *['persist', {:terminator => ->(target, result){ result == false } }]
+ else
+ base.define_callbacks *METHODS + [{:terminator => 'result == false'}]
+ base.define_callbacks *['persist', {:terminator => 'result == true'}]
+ end
# If Rails 3, support the new callback syntax
if base.singleton_class.method_defined?(:set_callback)
Please sign in to comment.
Something went wrong with that request. Please try again.