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:
parent
babc9eae9d
commit
600ff9abfc
4 changed files with 5 additions and 5 deletions
|
@ -4,7 +4,7 @@ module ActionView
|
|||
module Helpers #:nodoc:
|
||||
module JavaScriptHelper
|
||||
JS_ESCAPE_MAP = {
|
||||
'\\' => '\\\\',
|
||||
"\\" => "\\\\",
|
||||
"</" => '<\/',
|
||||
"\r\n" => '\n',
|
||||
"\n" => '\n',
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue