diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-28 17:03:36 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-28 17:03:36 -0700 |
commit | 957e6fbe2a313eceed9d3d8f6fa7e65f78756fe8 (patch) | |
tree | 1062a2893d96229bd03860b7b87ba2876fdef9a3 /activerecord | |
parent | ef2392f60bb1dae27f418e506eca56c9422e8f46 (diff) | |
download | rails-957e6fbe2a313eceed9d3d8f6fa7e65f78756fe8.tar.gz rails-957e6fbe2a313eceed9d3d8f6fa7e65f78756fe8.tar.bz2 rails-957e6fbe2a313eceed9d3d8f6fa7e65f78756fe8.zip |
dry up calls to arel.join()
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 9 |
1 files 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) |