From f045663dfc879b9516904255fb555f048c394b7b Mon Sep 17 00:00:00 2001 From: Fred Wu Date: Thu, 8 May 2014 15:57:49 +1000 Subject: Fixed HABTM's CollectionAssociation size HABTM should fall back to using the normal CollectionAssociation's size calculation if the collection is not cached or loaded. This addresses both #14913 and #14914 for master. --- .../lib/active_record/associations/has_many_through_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') 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 0b122d2070..aeb77e2753 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -23,7 +23,7 @@ module ActiveRecord elsif loaded? target.size else - count + super end end -- cgit v1.2.3