lib/authlogic/session/callbacks.rb in authlogic-2.1.4 vs lib/authlogic/session/callbacks.rb in authlogic-2.1.5
- old
+ new
@@ -64,10 +64,10 @@
def self.included(base) #:nodoc:
base.send :include, ActiveSupport::Callbacks
base.define_callbacks *METHODS
# If Rails 3, support the new callback syntax
- if base.singleton_class.method_defined?(:set_callback)
+ if base.send(base.respond_to?(:singleton_class) ? :singleton_class : :metaclass).method_defined?(:set_callback)
METHODS.each do |method|
base.class_eval <<-"end_eval", __FILE__, __LINE__
def self.#{method}(*methods, &block)
set_callback :#{method}, *methods, &block
end
\ No newline at end of file