From 65135d00a854edfd1684f5163db8e68fdb956ae0 Mon Sep 17 00:00:00 2001 From: Bradford Folkens Date: Wed, 29 Feb 2012 09:47:28 -0600 Subject: Delete should respect 'limit' Conflicts: lib/arel/visitors/to_sql.rb --- lib/arel/visitors/to_sql.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/arel/visitors/to_sql.rb') diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 7dfa86a575..6084f5746c 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -78,10 +78,10 @@ module Arel collector = visit o.relation, collector if o.wheres.any? collector << " WHERE " - inject_join o.wheres, collector, AND - else - collector + collector = inject_join o.wheres, collector, AND end + + maybe_visit o.limit, collector end # FIXME: we should probably have a 2-pass visitor for this -- cgit v1.2.3