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:
parent
a8f4a49e37
commit
acdd8e4f08
2 changed files with 7 additions and 0 deletions
|
@ -151,6 +151,7 @@ module Arel
|
|||
else
|
||||
@ctx.set_quantifier = nil
|
||||
end
|
||||
self
|
||||
end
|
||||
|
||||
def order *expr
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue