diff --git a/app/models/discuss.rb b/app/models/discuss.rb index a50b18a6f..e8fee2ed1 100644 --- a/app/models/discuss.rb +++ b/app/models/discuss.rb @@ -10,7 +10,7 @@ class Discuss < ApplicationRecord has_one :praise_tread_cache, as: :object, dependent: :destroy belongs_to :dis, polymorphic: true - belongs_to :challenge + belongs_to :challenge, optional: true after_create :send_tiding scope :children, -> (discuss_id){ where(parent_id: discuss_id).includes(:user).reorder(created_at: :asc) }