FEATURE: Decouple category/tag presence in sidebar from notifi level (#17273)

This commit is contained in:
Alan Guo Xiang Tan
2022-06-30 14:54:20 +08:00
committed by GitHub
parent db53c6650b
commit 3266350e80
36 changed files with 965 additions and 180 deletions

View File

@ -107,6 +107,10 @@ class User < ActiveRecord::Base
belongs_to :uploaded_avatar, class_name: 'Upload'
has_many :sidebar_section_links, dependent: :delete_all
has_many :category_sidebar_section_links, -> { where(linkable_type: "Category") }, class_name: 'SidebarSectionLink'
has_many :sidebar_tags, through: :sidebar_section_links, source: :linkable, source_type: "Tag"
delegate :last_sent_email_address, to: :email_logs
validates_presence_of :username