mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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
@@ -1,37 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DirectoryColumn < ActiveRecord::Base
|
||||
self.inheritance_column = nil
|
||||
|
||||
def self.automatic_column_names
|
||||
@automatic_column_names ||= [:likes_received,
|
||||
:likes_given,
|
||||
:topics_entered,
|
||||
:topic_count,
|
||||
:post_count,
|
||||
:posts_read,
|
||||
:days_visited]
|
||||
end
|
||||
|
||||
def self.active_column_names
|
||||
DirectoryColumn.where(type: [:automatic, :plugin]).where(enabled: true).pluck(:name).map(&:to_sym)
|
||||
end
|
||||
|
||||
@@plugin_directory_columns = []
|
||||
|
||||
enum type: { automatic: 0, user_field: 1, plugin: 2 }
|
||||
|
||||
belongs_to :user_field
|
||||
|
||||
def self.add_plugin_directory_column(name)
|
||||
@@plugin_directory_columns << name
|
||||
end
|
||||
|
||||
def self.plugin_directory_columns
|
||||
@@plugin_directory_columns
|
||||
end
|
||||
|
||||
def self.clear_plugin_directory_columns
|
||||
@@plugin_directory_columns = []
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user