Permalink
Browse files

Merge pull request #6373 from bogdan/callbacks_fix

AS::Callbacks: fix run_callbacks for objects with negative id
  • Loading branch information...
2 parents a6a8957 + 911a085 commit 88949f8ac1759d07fe8502f863dac20f509163c3 @josevalim josevalim 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 88949f8

Please sign in to comment.