From c0d0ca4a5f332de251f70b909673bbf91a9272ec Mon Sep 17 00:00:00 2001 From: David Gageot Date: Sat, 6 Oct 2012 01:31:08 +0200 Subject: [PATCH] SONAR-3765 backslash character '\' is duplicated on H2 --- .../WEB-INF/config/initializers/better_quoting.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb diff --git a/sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb b/sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb new file mode 100644 index 00000000000..60071f649ca --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/config/initializers/better_quoting.rb @@ -0,0 +1,14 @@ +# Override quoting for database without a specific jdbc adapter +# for example, H2 +# +# Default quoting leads to bugs, see SONAR-3765 +# +module ActiveRecord + module ConnectionAdapters # :nodoc: + module Quoting + def quote_string(s) + s.gsub(/'/, "''") # ' (for ruby-mode) + end + end + end +end -- 2.39.5