mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
DEV: remove all calls to SqlBuilder use DB.build instead
This is part of the migration to mini_sql, SqlBuilder.new is being deprecated and replaced with DB.build
This commit is contained in:
@@ -184,7 +184,7 @@ class BadgeGranter
|
||||
|
||||
# hack to allow for params, otherwise sanitizer will trigger sprintf
|
||||
count_sql = "SELECT COUNT(*) count FROM (#{sql}) q WHERE :backfill = :backfill"
|
||||
grant_count = SqlBuilder.map_exec(OpenStruct, count_sql, params).first.count.to_i
|
||||
grant_count = DB.query_single(count_sql, params).first.to_i
|
||||
|
||||
grants_sql =
|
||||
if opts[:target_posts]
|
||||
|
||||
@@ -386,7 +386,7 @@ class UserMerger
|
||||
conditions = Array.wrap(opts[:conditions])
|
||||
updates = Array.wrap(opts[:updates])
|
||||
|
||||
builder = SqlBuilder.new(<<~SQL)
|
||||
builder = DB.build(<<~SQL)
|
||||
UPDATE #{table_name} AS x
|
||||
/*set*/
|
||||
WHERE x.#{user_id_column_name} = :source_user_id AND NOT EXISTS(
|
||||
|
||||
Reference in New Issue
Block a user