aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorEhsan Yousefi <ehsan.yousefi@live.com>2015-11-08 00:52:08 +0330
committerEhsan Yousefi <ehsan.yousefi@live.com>2015-11-08 00:52:08 +0330
commite464ad76d0d11fb2ff85b67d8b988056fbee9eb6 (patch)
treeffb61542765b0063663cc6bde609093afaa67f1d /activerecord/lib
parentccdc84c09c618cc931e67da83873ad43f4ff8ff8 (diff)
downloadrails-e464ad76d0d11fb2ff85b67d8b988056fbee9eb6.tar.gz
rails-e464ad76d0d11fb2ff85b67d8b988056fbee9eb6.tar.bz2
rails-e464ad76d0d11fb2ff85b67d8b988056fbee9eb6.zip
Update belongs_to.rb
There is no need to to assign reflection name to a variable, because it's called once.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations/builder/belongs_to.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/builder/belongs_to.rb b/activerecord/lib/active_record/associations/builder/belongs_to.rb
index dae468ba54..81c535d962 100644
--- a/activerecord/lib/active_record/associations/builder/belongs_to.rb
+++ b/activerecord/lib/active_record/associations/builder/belongs_to.rb
@@ -116,8 +116,7 @@ module ActiveRecord::Associations::Builder # :nodoc:
end
def self.add_destroy_callbacks(model, reflection)
- name = reflection.name
- model.after_destroy lambda { |o| o.association(name).handle_dependency }
+ model.after_destroy lambda { |o| o.association(reflection.name).handle_dependency }
end
def self.define_validations(model, reflection)