1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix all rubocop violations

This commit is contained in:
Rafael Mendonça França 2021-06-08 23:35:59 +00:00
parent babc9eae9d
commit 600ff9abfc
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948
4 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@ module ActionView
module Helpers #:nodoc:
module JavaScriptHelper
JS_ESCAPE_MAP = {
'\\' => '\\\\',
"\\" => "\\\\",
"</" => '<\/',
"\r\n" => '\n',
"\n" => '\n',

View file

@ -59,7 +59,7 @@ module ActiveRecord
# Quotes a string, escaping any ' (single quote) and \ (backslash)
# characters.
def quote_string(s)
s.gsub('\\', '\&\&').gsub("'", "''") # ' (for ruby-mode)
s.gsub("\\", '\&\&').gsub("'", "''") # ' (for ruby-mode)
end
# Quotes the column name. Defaults to no quoting.

View file

@ -51,11 +51,11 @@ module ActiveRecord
end
key.gsub!('\"', '"')
key.gsub!('\\\\', '\\')
key.gsub!("\\\\", "\\")
if value
value.gsub!('\"', '"')
value.gsub!('\\\\', '\\')
value.gsub!("\\\\", "\\")
end
hash[key] = value

View file

@ -88,7 +88,7 @@ module ActiveRecord
if value.start_with?('"') && value.end_with?('"')
unquoted_value = value[1..-2]
unquoted_value.gsub!('""', '"')
unquoted_value.gsub!('\\\\', '\\')
unquoted_value.gsub!("\\\\", "\\")
unquoted_value
else
value