aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/visitors/to_sql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/arel/visitors/to_sql.rb')
-rw-r--r--activerecord/lib/arel/visitors/to_sql.rb3
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)])]