1
0
Fork 0
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:
Aaron Patterson 2011-04-21 15:50:19 -05:00
parent 0b9af9762a
commit f72989de5b
2 changed files with 15 additions and 0 deletions

View file

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

View file

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