From 957e6fbe2a313eceed9d3d8f6fa7e65f78756fe8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 28 Sep 2010 17:03:36 -0700 Subject: dry up calls to arel.join() --- activerecord/lib/active_record/relation/query_methods.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 502a220f5b..b7c15fb808 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -159,14 +159,13 @@ module ActiveRecord case join when Hash, Array, Symbol if array_of_strings?(join) - join_string = join.join(' ') - arel.join(Arel::SqlLiteral.new(join_string)) + join = Arel::SqlLiteral.new(join.join(' ')) end when String - arel.join(Arel::SqlLiteral.new(join)) - else - arel.join(join) + join = Arel::SqlLiteral.new(join) end + + arel.join(join) end arel.joins(arel) -- cgit v1.2.3