mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
23 lines
411 B
Ruby
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
|