File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
activerecord/lib/active_record/relation Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1910,15 +1910,19 @@ def build_with_value_from_hash(hash)
1910
1910
end
1911
1911
end
1912
1912
1913
- def build_with_expression_from_value ( value )
1913
+ def build_with_expression_from_value ( value , nested = false )
1914
1914
case value
1915
1915
when Arel ::Nodes ::SqlLiteral then Arel ::Nodes ::Grouping . new ( value )
1916
- when ActiveRecord ::Relation then value . arel
1916
+ when ActiveRecord ::Relation
1917
+ if nested
1918
+ value . arel . ast
1919
+ else
1920
+ value . arel
1921
+ end
1917
1922
when Arel ::SelectManager then value
1918
1923
when Array
1919
1924
parts = value . map do |query |
1920
- with_expression = build_with_expression_from_value ( query )
1921
- with_expression . try ( :ast ) || with_expression
1925
+ build_with_expression_from_value ( query , true )
1922
1926
end
1923
1927
1924
1928
parts . reduce do |result , value |
You can’t perform that action at this time.
0 commit comments