File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -1996,8 +1996,10 @@ def arel_column(field)
1996
1996
yield field
1997
1997
elsif Arel . arel_node? ( field )
1998
1998
field
1999
+ elsif is_symbol
2000
+ Arel . sql ( model . adapter_class . quote_table_name ( field ) , retryable : true )
1999
2001
else
2000
- Arel . sql ( is_symbol ? model . adapter_class . quote_table_name ( field ) : field )
2002
+ Arel . sql ( field )
2001
2003
end
2002
2004
end
2003
2005
Original file line number Diff line number Diff line change @@ -74,8 +74,13 @@ def on(*exprs)
74
74
def group ( *columns )
75
75
columns . each do |column |
76
76
# FIXME: backwards compat
77
- column = Nodes ::SqlLiteral . new ( column ) if String === column
78
- column = Nodes ::SqlLiteral . new ( column . to_s ) if Symbol === column
77
+ case column
78
+ when Nodes ::SqlLiteral
79
+ when String
80
+ column = Nodes ::SqlLiteral . new ( column )
81
+ when Symbol
82
+ column = Nodes ::SqlLiteral . new ( column . name )
83
+ end
79
84
80
85
@ctx . groups . push Nodes ::Group . new column
81
86
end
Original file line number Diff line number Diff line change @@ -708,12 +708,13 @@ def teardown
708
708
assert Post . find_by ( title : "Welcome to the weblog" )
709
709
assert_predicate Post , :exists?
710
710
a . books . to_a
711
+ Author . select ( :status ) . joins ( :books ) . group ( :status ) . to_a
711
712
end . select { |n | n . payload [ :name ] != "SCHEMA" }
712
713
713
- assert_equal 6 , notifications . length
714
+ assert_equal 7 , notifications . length
714
715
715
716
notifications . each do |n |
716
- assert n . payload [ :allow_retry ]
717
+ assert n . payload [ :allow_retry ] , " #{ n . payload [ :sql ] } was not retryable"
717
718
end
718
719
end
719
720
@@ -727,9 +728,10 @@ def teardown
727
728
assert_not_nil Post . find_by ( title : "Welcome to the weblog" )
728
729
assert_predicate Post , :exists?
729
730
a . books . to_a
731
+ Author . select ( :status ) . joins ( :books ) . group ( :status ) . to_a
730
732
end . select { |n | n . payload [ :name ] != "SCHEMA" }
731
733
732
- assert_equal 6 , notifications . length
734
+ assert_equal 7 , notifications . length
733
735
734
736
notifications . each do |n |
735
737
assert n . payload [ :allow_retry ] , "#{ n . payload [ :sql ] } was not retryable"
You can’t perform that action at this time.
0 commit comments