1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/lib/arel/visitors/mssql.rb
2011-02-02 15:09:54 -08:00

23 lines
411 B
Ruby

module Arel
module Visitors
class MSSQL < Arel::Visitors::ToSql
private
def build_subselect key, o
stmt = super
core = stmt.cores.first
core.top = Nodes::Top.new(o.limit.expr) if o.limit
stmt
end
def visit_Arel_Nodes_Limit o
""
end
def visit_Arel_Nodes_Top o
"TOP #{visit o.expr}"
end
end
end
end