diff options
author | Bradford Folkens <bfolkens@gmail.com> | 2012-02-29 09:47:28 -0600 |
---|---|---|
committer | Tamir Duberstein <tamird@squareup.com> | 2015-02-23 09:17:30 -0800 |
commit | 65135d00a854edfd1684f5163db8e68fdb956ae0 (patch) | |
tree | c76a238671cd9761c2250b9f903cdfc2b0b3254d /lib/arel/visitors | |
parent | aac9da257f291ad8d2d4f914528881c240848bb2 (diff) | |
download | rails-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')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 6 |
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 |