diff options
author | Ehsan Yousefi <ehsan.yousefi@live.com> | 2015-11-08 00:52:08 +0330 |
---|---|---|
committer | Ehsan Yousefi <ehsan.yousefi@live.com> | 2015-11-08 00:52:08 +0330 |
commit | e464ad76d0d11fb2ff85b67d8b988056fbee9eb6 (patch) | |
tree | ffb61542765b0063663cc6bde609093afaa67f1d /activerecord/lib | |
parent | ccdc84c09c618cc931e67da83873ad43f4ff8ff8 (diff) | |
download | rails-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.rb | 3 |
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) |