From 032ba7f7a62b90f9d7eb6a99a2c5f2153f094330 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 23 Dec 2019 14:40:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AF=84=E8=AE=BA=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/discuss.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) }