aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/visitors/mssql.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-03-20 01:23:15 +0900
committerGitHub <noreply@github.com>2019-03-20 01:23:15 +0900
commit7180fa7ba8ee8444de57bfcbc284c17e9bc1330f (patch)
treec5438925844f391f91e9d9d73adaf4ffb1cf4ea1 /activerecord/lib/arel/visitors/mssql.rb
parent12a1a6658c0eff71d528cdda25f29ef1c950d53a (diff)
parent8072d8653a32e7719342df25eecab688ac9e39cc (diff)
downloadrails-7180fa7ba8ee8444de57bfcbc284c17e9bc1330f.tar.gz
rails-7180fa7ba8ee8444de57bfcbc284c17e9bc1330f.tar.bz2
rails-7180fa7ba8ee8444de57bfcbc284c17e9bc1330f.zip
Merge pull request #35660 from kamipo/sanitize_as_sql_comment
Extract `sanitize_as_sql_comment` from SQL visitor into connection
Diffstat (limited to 'activerecord/lib/arel/visitors/mssql.rb')
-rw-r--r--activerecord/lib/arel/visitors/mssql.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/arel/visitors/mssql.rb b/activerecord/lib/arel/visitors/mssql.rb
index 85815baca2..05fe37c26f 100644
--- a/activerecord/lib/arel/visitors/mssql.rb
+++ b/activerecord/lib/arel/visitors/mssql.rb
@@ -82,7 +82,8 @@ module Arel # :nodoc: all
end
def visit_Arel_Nodes_OptimizerHints(o, collector)
- collector << "OPTION (#{sanitize_as_sql_comment(o).join(", ")})"
+ hints = o.expr.map { |v| sanitize_as_sql_comment(v) }.join(", ")
+ collector << "OPTION (#{hints})"
end
def get_offset_limit_clause(o)