1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Return self from #distinct so it's chainable

This commit is contained in:
Jordan Sexton 2014-05-06 15:38:26 -05:00
parent a8f4a49e37
commit acdd8e4f08
2 changed files with 7 additions and 0 deletions

View file

@ -151,6 +151,7 @@ module Arel
else
@ctx.set_quantifier = nil
end
self
end
def order *expr

View file

@ -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