From c31463d83d80353913b24168fc37d3fc580fe9f3 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 4 Mar 2020 12:18:30 +0800 Subject: [PATCH] fix error --- app/models/paper_criteria.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/paper_criteria.rb b/app/models/paper_criteria.rb index 0f030de..80405d8 100644 --- a/app/models/paper_criteria.rb +++ b/app/models/paper_criteria.rb @@ -16,7 +16,8 @@ class PaperCriteria def epaper_topics - EPaperTopic.where(:period.gte => self.start_date, :period.lte => self.end_date).can_display + tmp = EPaperTopic.where(:period.gte => self.start_date, :period.lte => self.end_date).can_display + tmp = EPaperTopic.where(:period.gte => self.start_date, :period.lte => self.end_date).limit(1) if tmp.first.nil? end def other_emails_ids