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

Merged
merged 1 commit into from May 18, 2012

2 participants

@josevalim josevalim merged commit 88949f8 into rails:master May 18, 2012
@gmile gmile commented on the diff May 18, 2012
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}"
@gmile
gmile added a line comment May 18, 2012

object_id potentially can be negative?

@bogdan
bogdan added a line comment May 18, 2012

Yes, it could.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment