From ac4a039a31dc575428b1632b3f07b2da237921ca Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 8 Dec 2004 17:39:44 +0000 Subject: 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 --- activerecord/lib/active_record/callbacks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index 2ffe9db693..7a95ca6bce 100755 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -191,7 +191,7 @@ module ActiveRecord 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: -- cgit v1.2.3