diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-08 14:44:42 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-08 14:44:42 -0800 |
commit | 50241eb2f07a2bce5201fc0bb50cb072d977c5d6 (patch) | |
tree | 52c0209a88423b9edcc2109a72503f967c1f5855 /activerecord/lib/active_record/associations | |
parent | d106925059cb76258ed8d5a539a7c266800a6b11 (diff) | |
parent | 77715951144a03ab5274f2267844da24775a5d13 (diff) | |
download | rails-50241eb2f07a2bce5201fc0bb50cb072d977c5d6.tar.gz rails-50241eb2f07a2bce5201fc0bb50cb072d977c5d6.tar.bz2 rails-50241eb2f07a2bce5201fc0bb50cb072d977c5d6.zip |
Merge pull request #8823 from acapilleri/target_reflection_has_associated_record
Refactor target_reflection_has_associated_record?
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_through_association.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index c3266f2bb4..d1458f30ba 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -114,11 +114,7 @@ module ActiveRecord end def target_reflection_has_associated_record? - if through_reflection.macro == :belongs_to && owner[through_reflection.foreign_key].blank? - false - else - true - end + !(through_reflection.macro == :belongs_to && owner[through_reflection.foreign_key].blank?) end def update_through_counter?(method) |