diff options
author | Angelo Capilleri <capilleri@yahoo.com> | 2013-01-08 21:53:35 +0100 |
---|---|---|
committer | Angelo Capilleri <capilleri@yahoo.com> | 2013-01-08 21:53:35 +0100 |
commit | 77715951144a03ab5274f2267844da24775a5d13 (patch) | |
tree | 7cd2bbd16a72fa9ed64724a8b25d3648df57ee3a | |
parent | e5d4367e191c55a61e4024aac1995edbfbf71090 (diff) | |
download | rails-77715951144a03ab5274f2267844da24775a5d13.tar.gz rails-77715951144a03ab5274f2267844da24775a5d13.tar.bz2 rails-77715951144a03ab5274f2267844da24775a5d13.zip |
target_reflection_has_associated_record? refactoring
-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) |