3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/helpers/coplan/comments_helper.rb', line 3
def ()
case .author_type
when "human"
CoPlan::User.find_by(id: .author_id)&.name || "Unknown"
when "local_agent"
user_name = CoPlan::User
.joins(:api_tokens)
.where(coplan_api_tokens: { id: .author_id })
.pick(:name) || "Agent"
.agent_name.present? ? "#{user_name} (#{.agent_name})" : user_name
when "cloud_persona"
AutomatedPlanReviewer.find_by(id: .author_id)&.name || "Reviewer"
else
.author_type
end
end
|