DEV: Prefer public_send over send.

This commit is contained in:
Guo Xiang Tan
2019-05-07 09:27:05 +08:00
parent 9be70a22cd
commit 152238b4cf
74 changed files with 216 additions and 129 deletions

View File

@@ -27,7 +27,7 @@ class ActiveRecord::Base
Discourse.deprecate("exec_sql should not be used anymore, please use DB.exec or DB.query instead!")
conn = ActiveRecord::Base.connection
sql = ActiveRecord::Base.send(:sanitize_sql_array, args)
sql = ActiveRecord::Base.public_send(:sanitize_sql_array, args)
conn.raw_connection.async_exec(sql)
end

View File

@@ -30,7 +30,7 @@ module FreedomPatches
SQL
hostname = `hostname` rescue ""
sql = ActiveRecord::Base.send(:sanitize_sql_array, [sql, {
sql = ActiveRecord::Base.public_send(:sanitize_sql_array, [sql, {
version: version || "",
duration: (time.real * 1000).to_i,
hostname: hostname,