lib/active_support/callbacks.rb in activesupport-3.0.0.beta2 vs lib/active_support/callbacks.rb in activesupport-3.0.0.beta3
- old
+ new
@@ -1,9 +1,9 @@
require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/class/inheritable_attributes'
require 'active_support/core_ext/kernel/reporting'
-require 'active_support/core_ext/object/singleton_class'
+require 'active_support/core_ext/kernel/singleton_class'
module ActiveSupport
# Callbacks are hooks into the lifecycle of an object that allow you to trigger logic
# before or after an alteration of the object state.
#
@@ -385,10 +385,10 @@
#
def __define_runner(symbol) #:nodoc:
send("_update_#{symbol}_superclass_callbacks")
body = send("_#{symbol}_callbacks").compile(nil)
- body, line = <<-RUBY_EVAL, __LINE__
+ body, line = <<-RUBY_EVAL, __LINE__ + 1
def _run_#{symbol}_callbacks(key = nil, &blk)
if self.class.send("_update_#{symbol}_superclass_callbacks")
self.class.__define_runner(#{symbol.inspect})
return _run_#{symbol}_callbacks(key, &blk)
end