From d95fbd7dba54cfbd282f808102dfdffa3499d669 Mon Sep 17 00:00:00 2001 From: pavel Date: Thu, 26 Oct 2017 23:16:54 +0200 Subject: fix initial count --- activerecord/lib/active_record/associations/alias_tracker.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/alias_tracker.rb b/activerecord/lib/active_record/associations/alias_tracker.rb index 07bd0a273b..14881cfe17 100644 --- a/activerecord/lib/active_record/associations/alias_tracker.rb +++ b/activerecord/lib/active_record/associations/alias_tracker.rb @@ -33,7 +33,7 @@ module ActiveRecord elsif join.respond_to? :left join.left.name == name ? 1 : 0 elsif join.is_a?(Hash) - join[name] + join.fetch(name, 0) else # this branch is reached by two tests: # -- cgit v1.2.3