mirror of
https://github.com/discourse/discourse.git
synced 2025-03-01 00:39:17 +00:00
DEV: fast pluck to use type_map in mini_sql
This commit is contained in:
parent
44091f20c6
commit
2f0e73f2d6
@ -2,8 +2,6 @@
|
||||
# of AR objects
|
||||
#
|
||||
#
|
||||
require_dependency 'sql_builder'
|
||||
|
||||
class ActiveRecord::Relation
|
||||
|
||||
# Note: In discourse, the following code is included in lib/sql_builder.rb
|
||||
@ -59,7 +57,7 @@ class ActiveRecord::Relation
|
||||
}
|
||||
|
||||
klass.connection.select_raw(relation.arel) do |result, _|
|
||||
result.type_map = SqlBuilder.pg_type_map
|
||||
result.type_map = DB.type_map
|
||||
result.nfields == 1 ? result.column_values(0) : result.values
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user