mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 08:49:03 +08: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:
@ -14,15 +14,14 @@ class SiteSettings::DbProvider
|
||||
return [] unless table_exists?
|
||||
|
||||
# Not leaking out AR records, cause I want all editing to happen via this API
|
||||
SqlBuilder.new("SELECT name, data_type, value FROM #{@model.table_name}").map_exec(OpenStruct)
|
||||
DB.query("SELECT name, data_type, value FROM #{@model.table_name}")
|
||||
end
|
||||
|
||||
def find(name)
|
||||
return nil unless table_exists?
|
||||
|
||||
# Not leaking out AR records, cause I want all editing to happen via this API
|
||||
SqlBuilder.new("SELECT name, data_type, value FROM #{@model.table_name} WHERE name = :name")
|
||||
.map_exec(OpenStruct, name: name)
|
||||
DB.query("SELECT name, data_type, value FROM #{@model.table_name} WHERE name = ?", name)
|
||||
.first
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user