aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2013-05-29 23:36:19 -0400
committerNeeraj Singh <neerajdotname@gmail.com>2013-06-22 08:33:03 +0530
commit32420bd4bcf20dc21e925474cbb0ac2b46722b80 (patch)
tree6a549374c68cbec52f22048245f39c94e5c5247c /activerecord/lib/active_record
parent88beaee64eeb29bec4a3477dedf6dbbb08b2e108 (diff)
downloadrails-32420bd4bcf20dc21e925474cbb0ac2b46722b80.tar.gz
rails-32420bd4bcf20dc21e925474cbb0ac2b46722b80.tar.bz2
rails-32420bd4bcf20dc21e925474cbb0ac2b46722b80.zip
flatten merged join_values before building the joins
fixes #10669 While joining_values special treatment is given to string values. By flattening the array it ensures that string values are detected as strings and not arrays.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index ca1de2d4dc..0200fcf69b 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -802,7 +802,7 @@ module ActiveRecord
def build_arel
arel = Arel::SelectManager.new(table.engine, table)
- build_joins(arel, joins_values) unless joins_values.empty?
+ build_joins(arel, joins_values.flatten) unless joins_values.empty?
collapse_wheres(arel, (where_values - ['']).uniq)