denise-oneill-inbox-ru's picture
Deploy Rails 8 Blog v1.0.0 from main 9acb6e4
5d27770 verified
Raw History Blame Contribute Delete
267 Bytes
class Comment < ApplicationRecord
include Discard::Model
include Auditable
belongs_to :user
belongs_to :post, counter_cache: true
validates :body, presence: true
def display_body
discarded? ? I18n.t("comments.deleted_placeholder") : body
end
end