Merge branch 'develop' into feat/read-only-token
This commit is contained in:
@@ -109,6 +109,7 @@ class Account < ApplicationRecord
|
||||
|
||||
before_validation :validate_limit_keys
|
||||
after_create_commit :notify_creation
|
||||
after_update_commit :clear_unread_conversation_counts_cache, if: :saved_change_to_feature_conversation_unread_counts?
|
||||
after_destroy :remove_account_sequences
|
||||
|
||||
def agents
|
||||
|
||||
@@ -55,10 +55,14 @@ class Article < ApplicationRecord
|
||||
before_validation :ensure_article_slug
|
||||
before_validation :ensure_locale_in_article
|
||||
|
||||
# Slugs that collide with help center routes (e.g. /hc/:slug/:locale/search)
|
||||
RESERVED_SLUGS = %w[search articles categories].freeze
|
||||
|
||||
validates :account_id, presence: true
|
||||
validates :author_id, presence: true
|
||||
validates :title, presence: true
|
||||
validates :content, presence: true, if: :published?
|
||||
validates :slug, exclusion: { in: RESERVED_SLUGS }
|
||||
|
||||
# ensuring that the position is always set correctly
|
||||
before_create :add_position_to_article
|
||||
|
||||
Reference in New Issue
Block a user