aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-02 15:11:47 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-02 15:28:50 -0700
commit32bacb1ce80a06f328a0f32ca27c07d8417704bc (patch)
treeb1d9ae7f01e69d33d3f301ec90bae4432bbb74bf /activerecord/lib/active_record/associations
parentea11af9568744a665f8ddc8f0cdca7407cc51d2b (diff)
downloadrails-32bacb1ce80a06f328a0f32ca27c07d8417704bc.tar.gz
rails-32bacb1ce80a06f328a0f32ca27c07d8417704bc.tar.bz2
rails-32bacb1ce80a06f328a0f32ca27c07d8417704bc.zip
cache the name and options on the stack
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/builder/collection_association.rb4
1 files changed, 3 insertions, 1 deletions
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