diff options
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 25b7f005ea..d45253abd5 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -52,6 +52,7 @@ module Arel o.cores.map { |x| visit x }.join, ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?), ("LIMIT #{o.limit}" if o.limit), + (visit(o.offset) if o.offset), (visit(o.lock) if o.lock), ].compact.join ' ' end @@ -70,6 +71,10 @@ module Arel "HAVING #{visit o.expr}" end + def visit_Arel_Nodes_Offset o + "OFFSET #{visit o.value}" + end + # FIXME: this does nothing on SQLLite3, but should do things on other # databases. def visit_Arel_Nodes_Lock o |