Skip to content

Commit

Permalink
Improving performance of the SQL query that retrieves the tipline pla…
Browse files Browse the repository at this point in the history
…tforms for which data analytics is available.

Reference: CV2-5821.
  • Loading branch information
caiosba committed Feb 21, 2025
1 parent 0774848 commit 1b23928
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def get_dashboard_exported_data(filters, dashboard_type)

# Platforms for which statistics are available (e.g., at least one media request)
def statistics_platforms
TiplineRequest.joins(:project_media).where('project_medias.team_id' => self.id).group('platform').count.keys
TiplineRequest.joins(:project_media).where('project_medias.team_id' => self.id).distinct.pluck(:platform)
end

# private
Expand Down

0 comments on commit 1b23928

Please sign in to comment.