aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/to_sql.rb
diff options
context:
space:
mode:
authorBradford Folkens <bfolkens@gmail.com>2012-02-29 09:47:28 -0600
committerTamir Duberstein <tamird@squareup.com>2015-02-23 09:17:30 -0800
commit65135d00a854edfd1684f5163db8e68fdb956ae0 (patch)
treec76a238671cd9761c2250b9f903cdfc2b0b3254d /lib/arel/visitors/to_sql.rb
parentaac9da257f291ad8d2d4f914528881c240848bb2 (diff)
downloadrails-65135d00a854edfd1684f5163db8e68fdb956ae0.tar.gz
rails-65135d00a854edfd1684f5163db8e68fdb956ae0.tar.bz2
rails-65135d00a854edfd1684f5163db8e68fdb956ae0.zip
Delete should respect 'limit'
Conflicts: lib/arel/visitors/to_sql.rb
Diffstat (limited to 'lib/arel/visitors/to_sql.rb')
-rw-r--r--lib/arel/visitors/to_sql.rb6
1 files changed, 3 insertions, 3 deletions
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