Skip to content
Browse files

Callbacks added to the inheritable que should only be called once -- …

…even as the definition is read again

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@90 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 04d032e commit ac4a039a31dc575428b1632b3f07b2da237921ca @dhh dhh committed Dec 8, 2004
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/callbacks.rb
View
2 activerecord/lib/active_record/callbacks.rb
@@ -191,7 +191,7 @@ class << self
alias_method :destroy, :destroy_with_callbacks
end
- CALLBACKS.each { |cb| base.class_eval("def self.#{cb}(*methods) write_inheritable_array(\"#{cb}\", methods) end") }
+ CALLBACKS.each { |cb| base.class_eval("def self.#{cb}(*methods) write_inheritable_attribute(\"#{cb}\", (read_inheritable_attribute(\"#{cb}\") + methods).uniq) end") }
end
module ClassMethods #:nodoc:

0 comments on commit ac4a039

Please sign in to comment.
Something went wrong with that request. Please try again.