From 185ae3af52769d8b8e85dab69520fbaba51f6d81 Mon Sep 17 00:00:00 2001 From: Jesse Chavez Date: Wed, 3 Jul 2024 06:01:23 +1000 Subject: [PATCH] Override default NULL FIRST and NULL LAST with nothing --- lib/arel/visitors/sqlserver.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/arel/visitors/sqlserver.rb b/lib/arel/visitors/sqlserver.rb index eccda8ecb..27172ed65 100644 --- a/lib/arel/visitors/sqlserver.rb +++ b/lib/arel/visitors/sqlserver.rb @@ -51,6 +51,16 @@ def visit_Arel_Nodes_Limit o, collector end end + # Override the default in arel ToSql class + def visit_Arel_Nodes_NullsFirst(o, collector) + visit o.expr, collector + end + + # Override the default in arel ToSql class + def visit_Arel_Nodes_NullsLast(o, collector) + visit o.expr, collector + end + def visit_Arel_Nodes_Grouping(o, collector) remove_invalid_ordering_from_select_statement(o.expr) super