Skip to content

Commit 2337ee8

Browse files
committed
Add note about Arel.sql in documentation for sanitize_sql_array
1 parent f5972b4 commit 2337ee8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

activerecord/lib/active_record/sanitization.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ def sanitize_sql_like(string, escape_character = "\\")
155155
#
156156
# sanitize_sql_array(["role = ?", 0])
157157
# # => "role = '0'"
158+
#
159+
# Before using this method, please consider if Arel.sql would be better for your use-case
158160
def sanitize_sql_array(ary)
159161
statement, *values = ary
160162
if values.first.is_a?(Hash) && /:\w+/.match?(statement)

0 commit comments

Comments
 (0)