Permalink
Browse files

AS::Callbacks: fix run_callbacks for objects with negative id

  • Loading branch information...
1 parent a6a8957 commit 911a0859ac065aa8e8834ac985353d659c7c7b65 @bogdan bogdan committed May 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/callbacks.rb
@@ -329,7 +329,7 @@ module ClassMethods
# 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

0 comments on commit 911a085

Please sign in to comment.