提交 38d4ea7c 编写于 作者: Z Zachary Scott

Merge pull request #15723 from akshay-vishnoi/sql-correction

[ci skip] Use `an` for SQL
......@@ -423,7 +423,7 @@
*Eric Chahin*
* `sanitize_sql_like` helper method to escape a string for safe use in a SQL
* `sanitize_sql_like` helper method to escape a string for safe use in an SQL
LIKE statement.
Example:
......@@ -459,7 +459,7 @@
*Lauro Caetano*
* Calling `delete_all` on an unloaded `CollectionProxy` no longer
generates a SQL statement containing each id of the collection:
generates an SQL statement containing each id of the collection:
Before:
......
......@@ -107,7 +107,7 @@ def sanitize_sql_hash_for_assignment(attrs, table)
end.join(', ')
end
# Sanitizes a +string+ so that it is safe to use within a sql
# Sanitizes a +string+ so that it is safe to use within an SQL
# LIKE statement. This method uses +escape_character+ to escape all occurrences of "\", "_" and "%"
def sanitize_sql_like(string, escape_character = "\\")
pattern = Regexp.union(escape_character, "%", "_")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册