From c556b73fbb79596170c9a9183a943bbf20c8a0b9 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 31 Jul 2020 11:03:38 +0800 Subject: [PATCH] fix bug --- app/models/bulletin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb index d79c294..970c355 100644 --- a/app/models/bulletin.rb +++ b/app/models/bulletin.rb @@ -174,6 +174,6 @@ class Bulletin end def open_comment_for_user(user) role_ids = user.member_profile.roles.collect{|v| v.id.to_s} rescue ['visitor'] - !self.comment_end_time.blank? && self.open_comment && self.comment_end_time > Time.now && (self.comment_role.any?{|v| role_ids.include?(v)} || self.comment_role.include?('visitor') || (self.comment_role.include?('all_member') && role_ids[0] != 'visitor')) + self.open_comment && (self.comment_end_time.blank? || self.comment_end_time > Time.now) && (self.comment_role.any?{|v| role_ids.include?(v)} || self.comment_role.include?('visitor') || (self.comment_role.include?('all_member') && role_ids[0] != 'visitor')) end end