From 26fd5f0cd58814a0391ea681aacf98370cc079a8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 21 May 2013 20:13:29 -0700 Subject: just set the default argument, a nil parent should be an error --- activerecord/lib/active_record/associations/join_dependency.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 246512fcd0..5aa17e5fbb 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -131,8 +131,7 @@ module ActiveRecord ref[association.reflection.name] ||= {} end - def build(associations, parent = nil, join_type = Arel::InnerJoin) - parent ||= join_parts.last + def build(associations, parent = join_parts.last, join_type = Arel::InnerJoin) case associations when Symbol, String reflection = parent.reflections[associations.intern] or -- cgit v1.2.3