From ee8ce22a185f0bf3770f788ab415e09f703d2101 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 12 May 2016 16:14:06 +0800 Subject: [PATCH] now questions with blank title wont be shown --- app/models/qa.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/qa.rb b/app/models/qa.rb index 2212203..c372008 100644 --- a/app/models/qa.rb +++ b/app/models/qa.rb @@ -24,7 +24,7 @@ class Qa accepts_nested_attributes_for :qa_files, :allow_destroy => true accepts_nested_attributes_for :qa_links, :allow_destroy => true - scope :can_display, ->{where(:is_hidden=>false).order_by([:is_top, :desc])} + scope :can_display, ->{where(:is_hidden=>false,:title.ne => "").order_by([:is_top, :desc])} # belongs_to :qa_category