From 32bacb1ce80a06f328a0f32ca27c07d8417704bc Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 2 Oct 2013 15:11:47 -0700 Subject: cache the name and options on the stack --- .../lib/active_record/associations/builder/collection_association.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/builder/collection_association.rb b/activerecord/lib/active_record/associations/builder/collection_association.rb index 38a70f3efd..d640446a6d 100644 --- a/activerecord/lib/active_record/associations/builder/collection_association.rb +++ b/activerecord/lib/active_record/associations/builder/collection_association.rb @@ -25,8 +25,10 @@ module ActiveRecord::Associations::Builder def define_callbacks(model, reflection) super + name = reflection.name + options = reflection.options CALLBACKS.each { |callback_name| - define_callback(model, callback_name, reflection.name, reflection.options) + define_callback(model, callback_name, name, options) } end -- cgit v1.2.3