feat: Add support to uncategorized articles (#6912)

This commit is contained in:
Tejaswini Chile
2023-05-02 15:35:26 +05:30
committed by GitHub
parent c8041392dc
commit 847d7ea082
18 changed files with 103 additions and 46 deletions

View File

@@ -41,7 +41,7 @@ class Article < ApplicationRecord
inverse_of: :associated_articles,
optional: true
belongs_to :account
belongs_to :category
belongs_to :category, optional: true
belongs_to :portal
belongs_to :author, class_name: 'User'
@@ -49,7 +49,6 @@ class Article < ApplicationRecord
before_validation :ensure_article_slug
validates :account_id, presence: true
validates :category_id, presence: true
validates :author_id, presence: true
validates :title, presence: true
validates :content, presence: true