diff options
-rw-r--r-- | lib/arel/select_manager.rb | 1 | ||||
-rw-r--r-- | test/test_select_manager.rb | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb index fe0d26a16e..7ec9fdba79 100644 --- a/lib/arel/select_manager.rb +++ b/lib/arel/select_manager.rb @@ -151,6 +151,7 @@ module Arel else @ctx.set_quantifier = nil end + self end def order *expr diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb index 837486fb46..611bba10c2 100644 --- a/test/test_select_manager.rb +++ b/test/test_select_manager.rb @@ -1073,6 +1073,12 @@ module Arel manager.distinct(false) manager.ast.cores.last.set_quantifier.must_equal nil end + + it "chains" do + manager = Arel::SelectManager.new Table.engine + manager.distinct.must_equal manager + manager.distinct(false).must_equal manager + end end end end |