diff options
author | Richard Schneeman <richard.schneeman@gmail.com> | 2015-11-07 15:46:02 -0600 |
---|---|---|
committer | Richard Schneeman <richard.schneeman@gmail.com> | 2015-11-07 15:46:02 -0600 |
commit | 25673f47b607528d12b0f4d1bace30b2c41a97fa (patch) | |
tree | ffb61542765b0063663cc6bde609093afaa67f1d | |
parent | ccdc84c09c618cc931e67da83873ad43f4ff8ff8 (diff) | |
parent | e464ad76d0d11fb2ff85b67d8b988056fbee9eb6 (diff) | |
download | rails-25673f47b607528d12b0f4d1bace30b2c41a97fa.tar.gz rails-25673f47b607528d12b0f4d1bace30b2c41a97fa.tar.bz2 rails-25673f47b607528d12b0f4d1bace30b2c41a97fa.zip |
Merge pull request #22218 from EhsanYousefi/patch-2
Fix Unnecessary variable assignment /associations/builder/belongs_to.rb#add_destroy_callbacks
-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) |