diff options
Diffstat (limited to 'lib/arel/select_manager.rb')
-rw-r--r-- | lib/arel/select_manager.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb index adffcca764..37405b4596 100644 --- a/lib/arel/select_manager.rb +++ b/lib/arel/select_manager.rb @@ -172,10 +172,16 @@ module Arel end def take limit - @ast.limit = Nodes::Limit.new(limit) - @ctx.top = Nodes::Top.new(limit) + if limit + @ast.limit = Nodes::Limit.new(limit) + @ctx.top = Nodes::Top.new(limit) + else + @ast.limit = nil + @ctx.top = nil + end self end + alias limit= take def join_sql return nil if @ctx.source.right.empty? |