mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:55:25 +08:00
Use db schema for tags instead of plugin store and custom fields
This commit is contained in:
@ -92,6 +92,9 @@ class Topic < ActiveRecord::Base
|
||||
has_many :allowed_users, through: :topic_allowed_users, source: :user
|
||||
has_many :queued_posts
|
||||
|
||||
has_many :topic_tags, dependent: :destroy
|
||||
has_many :tags, through: :topic_tags
|
||||
|
||||
has_one :top_topic
|
||||
belongs_to :user
|
||||
belongs_to :last_poster, class_name: 'User', foreign_key: :last_post_user_id
|
||||
@ -1042,11 +1045,6 @@ SQL
|
||||
builder.exec.first["count"].to_i
|
||||
end
|
||||
|
||||
def tags
|
||||
result = custom_fields[DiscourseTagging::TAGS_FIELD_NAME]
|
||||
[result].flatten unless result.blank?
|
||||
end
|
||||
|
||||
def convert_to_public_topic(user)
|
||||
public_topic = TopicConverter.new(self, user).convert_to_public_topic
|
||||
add_small_action(user, "public_topic") if public_topic
|
||||
|
Reference in New Issue
Block a user