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:
Sam
2018-06-20 17:53:49 +10:00
parent 76707eec1b
commit cb824a6b33
25 changed files with 338 additions and 372 deletions
+1 -1
View File
@@ -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]
+1 -1
View File
@@ -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(