diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/select_manager.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb index 37405b4596..7f533fa91b 100644 --- a/lib/arel/select_manager.rb +++ b/lib/arel/select_manager.rb @@ -18,10 +18,19 @@ module Arel @ctx.wheres end + def offset + @ast.offset && @ast.offset.expr + end + def skip amount - @ast.offset = Nodes::Offset.new(amount) + if amount + @ast.offset = Nodes::Offset.new(amount) + else + @ast.offset = nil + end self end + alias :offset= :skip ### # Produces an Arel::Nodes::Exists node |