Skip to content

Commit e81cf4b

Browse files
committed
Add an example for AR.db_warnings_ignore [ci skip]
1 parent e982267 commit e81cf4b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

activerecord/lib/active_record.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ def self.db_warnings_action=(action)
259259
##
260260
# :singleton-method: db_warnings_ignore
261261
# Specify allowlist of database warnings.
262+
# Can be a string, regular expression, or an error code from the database.
263+
#
264+
# ActiveRecord::Base.db_warnings_ignore = [/^SHOW WARNINGS` did not return the warnings/, "01000"]
262265
singleton_class.attr_accessor :db_warnings_ignore
263266
self.db_warnings_ignore = []
264267

0 commit comments

Comments
 (0)