提交 f72989de 编写于 作者: A Aaron Patterson

raising not implemented exceptions for distinct on where it is not supported

上级 0b9af976
......@@ -142,6 +142,10 @@ def visit_Arel_Nodes_Distinct o
'DISTINCT'
end
def visit_Arel_Nodes_DistinctOn o
raise NotImplementedError, 'DISTINCT ON not implemented for this db'
end
def visit_Arel_Nodes_With o
"WITH #{o.children.map { |x| visit x }.join(', ')}"
end
......
......@@ -299,6 +299,17 @@ def quote value, column = nil
}
end
end
describe 'distinct on' do
it 'raises not implemented error' do
core = Arel::Nodes::SelectCore.new
core.set_quantifier = Arel::Nodes::DistinctOn.new(Arel.sql('aaron'))
assert_raises(NotImplementedError) do
@visitor.accept(core)
end
end
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册