mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
raising not implemented exceptions for distinct on where it is not supported
This commit is contained in:
parent
0b9af9762a
commit
f72989de5b
2 changed files with 15 additions and 0 deletions
|
@ -142,6 +142,10 @@ key on UpdateManager using UpdateManager#key=
|
|||
'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 @@ module Arel
|
|||
}
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue