use counter culture and move the optimisation under feature flag

This commit is contained in:
Tanmay Deep Sharma
2026-02-03 20:26:03 +05:30
parent 6a053e975e
commit 6e85dcbbce
10 changed files with 69 additions and 20 deletions
+3 -1
View File
@@ -97,7 +97,9 @@ class Conversation < ApplicationRecord
).sort_on_last_user_message_at
}
belongs_to :account, counter_cache: true
belongs_to :account
counter_culture :account,
column_name: proc { |model| "#{model.status}_conversations_count" }
belongs_to :inbox
belongs_to :assignee, class_name: 'User', optional: true, inverse_of: :assigned_conversations
belongs_to :assignee_agent_bot, class_name: 'AgentBot', optional: true