Skip to content

Commit 7d43e59

Browse files
tenderlovemetaskills
authored andcommitted
use an attribute node with the table name rather than referencing the connection
1 parent 6aa1561 commit 7d43e59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/arel/visitors/sqlserver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def order(*exprs)
3535
case x
3636
when Arel::Attributes::Attribute
3737
c = engine.connection
38-
tn = x.relation.table_alias || x.relation.name
39-
expr = Arel::Nodes::SqlLiteral.new "#{c.quote_table_name(tn)}.#{c.quote_column_name(x.name)}"
38+
table = Arel::Table.new(x.relation.table_alias || x.relation.name)
39+
expr = table[x.name]
4040
Arel::Nodes::Ordering.new expr
4141
when String
4242
x.split(',').map do |s|

0 commit comments

Comments
 (0)