Skip to content

Commit

Permalink
Merge pull request rails#6373 from bogdan/callbacks_fix
Browse files Browse the repository at this point in the history
AS::Callbacks: fix run_callbacks for objects with negative id
  • Loading branch information
josevalim committed May 18, 2012
2 parents a6a8957 + 911a085 commit 88949f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/callbacks.rb
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 88949f8

Please sign in to comment.