From f2e046847dc5bef56dd6273c85032efa94e3eea6 Mon Sep 17 00:00:00 2001 From: Justin Rhinesmith Date: Mon, 8 Jan 2018 11:55:48 -0800 Subject: [PATCH] make_constraints returns an array in rails 5.2, so remove unnecessary coercing --- lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb b/lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb index 98af2bd..41bfe61 100644 --- a/lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb +++ b/lib/polyamorous/activerecord_5.2_ruby_2/join_dependency.rb @@ -84,7 +84,7 @@ def make_polyamorous_left_outer_joins(parent, child) join_type = Arel::Nodes::OuterJoin info = make_constraints parent, child, tables, join_type - [info] + child.children.flat_map { |c| + info + child.children.flat_map { |c| make_polyamorous_left_outer_joins(child, c) } end @@ -96,7 +96,7 @@ def make_polyamorous_inner_joins(parent, child) join_type = child.join_type || Arel::Nodes::InnerJoin info = make_constraints parent, child, tables, join_type - [info] + child.children.flat_map { |c| + info + child.children.flat_map { |c| make_polyamorous_inner_joins(child, c) } end