Bug: Fixed private note being sent to customer (#837)

This commit is contained in:
sony-mathew
2020-05-10 13:14:57 +05:30
parent 628e0c8423
commit a75f49ddcc
2 changed files with 3 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ class Message < ApplicationRecord
# .succ is a hack to avoid https://makandracards.com/makandra/1057-why-two-ruby-time-objects-are-not-equal-although-they-appear-to-be
scope :unread_since, ->(datetime) { where('EXTRACT(EPOCH FROM created_at) > (?)', datetime.to_i.succ) }
scope :chat, -> { where.not(message_type: :activity).where.not(private: true) }
scope :chat, -> { where.not(message_type: :activity).where(private: false) }
default_scope { order(created_at: :asc) }
belongs_to :account