mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
AS::Callbacks: fix run_callbacks for objects with negative id
This commit is contained in:
parent
a6a8957132
commit
911a0859ac
1 changed files with 1 additions and 1 deletions
|
@ -329,7 +329,7 @@ module ActiveSupport
|
||||||
# This generated method plays caching role.
|
# This generated method plays caching role.
|
||||||
def __define_callbacks(kind, object) #:nodoc:
|
def __define_callbacks(kind, object) #:nodoc:
|
||||||
chain = object.send("_#{kind}_callbacks")
|
chain = object.send("_#{kind}_callbacks")
|
||||||
name = "_run_callbacks_#{chain.object_id}"
|
name = "_run_callbacks_#{chain.object_id.abs}"
|
||||||
unless object.respond_to?(name, true)
|
unless object.respond_to?(name, true)
|
||||||
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
||||||
def #{name}() #{chain.compile} end
|
def #{name}() #{chain.compile} end
|
||||||
|
|
Loading…
Reference in a new issue