aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/visitors
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/arel/visitors')
-rw-r--r--activerecord/lib/arel/visitors/to_sql.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/arel/visitors/to_sql.rb b/activerecord/lib/arel/visitors/to_sql.rb
index 099bf5efb0..583f920290 100644
--- a/activerecord/lib/arel/visitors/to_sql.rb
+++ b/activerecord/lib/arel/visitors/to_sql.rb
@@ -786,7 +786,9 @@ module Arel # :nodoc: all
end
def sanitize_as_sql_comment(o)
- o.expr.map { |v| v.gsub(%r{ /\*\+?\s* | \s*\*/ }x, "") }
+ o.expr.map { |v|
+ v.gsub(%r{ (/ (?: | \g<1>) \*) \+? \s* | \s* (\* (?: | \g<2>) /) }x, "")
+ }
end
def collect_optimizer_hints(o, collector)