mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 13:35:27 +08:00
DEV: Revert 3 commits for plugin API to add directory columns (#13423)
This commit is contained in:

committed by
GitHub

parent
c47f55253f
commit
95b51669ad
@ -618,18 +618,16 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def directory_columns_json
|
||||
types = DirectoryColumn.types
|
||||
DirectoryColumn
|
||||
.left_joins(:user_field)
|
||||
.where(enabled: true)
|
||||
.order(:position)
|
||||
.pluck('directory_columns.id',
|
||||
'directory_columns.name',
|
||||
'directory_columns.type',
|
||||
.pluck('directory_columns.name',
|
||||
'directory_columns.automatic',
|
||||
'directory_columns.icon',
|
||||
'user_fields.id',
|
||||
'user_fields.name')
|
||||
.map { |column| { id: column[0], name: column[1] || column[5], type: types.key(column[2]), icon: column[3], user_field_id: column[4] } }
|
||||
.map { |column| { name: column[0] || column[4], automatic: column[1], icon: column[2], user_field_id: column[3] } }
|
||||
.to_json
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user