chore: Add assigned_count to conversation APIs (#2665)

This commit is contained in:
Sojan Jose
2021-07-19 19:10:58 +05:30
committed by GitHub
parent a235e82a02
commit 217dd8a6f0
7 changed files with 40 additions and 18 deletions

View File

@@ -49,6 +49,7 @@ class Conversation < ApplicationRecord
scope :latest, -> { order(last_activity_at: :desc) }
scope :unassigned, -> { where(assignee_id: nil) }
scope :assigned, -> { where.not(assignee_id: nil) }
scope :assigned_to, ->(agent) { where(assignee_id: agent.id) }
belongs_to :account