diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-09-30 20:17:41 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-10-01 11:53:15 +0900 |
commit | 6d40d2d3d1f3766551e74607a718a5ec97963bbf (patch) | |
tree | 8c387da07c7fc7c14c6a09072fda46173e6d71a0 /activerecord/lib/arel/visitors/to_sql.rb | |
parent | 322c5704e5ab8cc9bc3cfffecd3b06641d95f2b4 (diff) | |
download | rails-6d40d2d3d1f3766551e74607a718a5ec97963bbf.tar.gz rails-6d40d2d3d1f3766551e74607a718a5ec97963bbf.tar.bz2 rails-6d40d2d3d1f3766551e74607a718a5ec97963bbf.zip |
Handle UPDATE/DELETE with OFFSET in Arel
Diffstat (limited to 'activerecord/lib/arel/visitors/to_sql.rb')
-rw-r--r-- | activerecord/lib/arel/visitors/to_sql.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/arel/visitors/to_sql.rb b/activerecord/lib/arel/visitors/to_sql.rb index 575bfd6e36..0172204fc8 100644 --- a/activerecord/lib/arel/visitors/to_sql.rb +++ b/activerecord/lib/arel/visitors/to_sql.rb @@ -88,6 +88,7 @@ module Arel # :nodoc: all core.wheres = o.wheres core.projections = [key] stmt.limit = o.limit + stmt.offset = o.offset stmt.orders = o.orders stmt end @@ -800,7 +801,7 @@ module Arel # :nodoc: all end def collect_where_for(o, collector) - if o.orders.empty? && o.limit.nil? + if o.orders.empty? && o.limit.nil? && o.offset.nil? wheres = o.wheres else wheres = [Nodes::In.new(o.key, [build_subselect(o.key, o)])] |