This commit is contained in:
chiu 2020-07-31 11:03:38 +08:00
parent 6b29a2c2a1
commit c556b73fbb
1 changed files with 1 additions and 1 deletions

View File

@ -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