Skip to content

Commit

Permalink
AS::Callbacks: fix run_callbacks for objects with negative id
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan committed May 18, 2012
1 parent a6a8957 commit 911a085
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/callbacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 911a085

Please sign in to comment.