aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/has_many_through_association.rb
diff options
context:
space:
mode:
authorAngelo Capilleri <capilleri@yahoo.com>2013-01-08 21:53:35 +0100
committerAngelo Capilleri <capilleri@yahoo.com>2013-01-08 21:53:35 +0100
commit77715951144a03ab5274f2267844da24775a5d13 (patch)
tree7cd2bbd16a72fa9ed64724a8b25d3648df57ee3a /activerecord/lib/active_record/associations/has_many_through_association.rb
parente5d4367e191c55a61e4024aac1995edbfbf71090 (diff)
downloadrails-77715951144a03ab5274f2267844da24775a5d13.tar.gz
rails-77715951144a03ab5274f2267844da24775a5d13.tar.bz2
rails-77715951144a03ab5274f2267844da24775a5d13.zip
target_reflection_has_associated_record? refactoring
Diffstat (limited to 'activerecord/lib/active_record/associations/has_many_through_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/has_many_through_association.rb6
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)