Skip to content

Commit 1afe4c6

Browse files
committed
Cleanup
1 parent 4191d87 commit 1afe4c6

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

lib/arel/visitors/sqlserver.rb

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,7 @@ def visit_Arel_Nodes_Concat(o, collector)
2929
visit o.right, collector
3030
end
3131

32-
# def visit_Arel_Nodes_UpdateStatement(o, collector)
33-
# if has_join_and_composite_primary_key?(o)
34-
# update_statement_using_join(o, collector)
35-
# else
36-
# o.limit = Nodes::Limit.new(9_223_372_036_854_775_807) if o.orders.any? && o.limit.nil?
37-
#
38-
# super
39-
# end
40-
# end
41-
32+
# Same as SQLite and PostgreSQL.
4233
def visit_Arel_Nodes_UpdateStatement(o, collector)
4334
collector.retryable = false
4435
o = prepare_update_statement(o)
@@ -84,12 +75,8 @@ def visit_Arel_Nodes_UpdateStatement(o, collector)
8475
maybe_visit o.limit, collector
8576
end
8677

87-
# In the simple case, PostgreSQL allows us to place FROM or JOINs directly into the UPDATE
88-
# query. However, this does not allow for LIMIT, OFFSET and ORDER. To support
89-
# these, we must use a subquery.
78+
# Same as PostgreSQL except we need to add limit if using subquery.
9079
def prepare_update_statement(o)
91-
92-
9380
if has_join_sources?(o) && !has_limit_or_offset_or_orders?(o) && !has_group_by_and_having?(o)
9481
o
9582
else

0 commit comments

Comments
 (0)