Use db schema for tags instead of plugin store and custom fields

This commit is contained in:
Neil Lalonde
2016-05-04 14:02:47 -04:00
parent ebd4b45771
commit f13470b96b
33 changed files with 726 additions and 186 deletions

View File

@ -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