From 911a0859ac065aa8e8834ac985353d659c7c7b65 Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Fri, 18 May 2012 09:50:09 +0300 Subject: AS::Callbacks: fix run_callbacks for objects with negative id --- activesupport/lib/active_support/callbacks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index af683d37ed..a9253c186d 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -329,7 +329,7 @@ module ActiveSupport # This generated method plays caching role. def __define_callbacks(kind, object) #:nodoc: chain = object.send("_#{kind}_callbacks") - name = "_run_callbacks_#{chain.object_id}" + name = "_run_callbacks_#{chain.object_id.abs}" unless object.respond_to?(name, true) class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1 def #{name}() #{chain.compile} end -- cgit v1.2.3