Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Adding DATE casts to the Reactions dashboard report #235

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class Engine < ::Rails::Engine
FROM discourse_reactions_reactions as drr
LEFT OUTER JOIN discourse_reactions_reaction_users as drru on drr.id = drru.reaction_id
WHERE drr.reaction_users_count IS NOT NULL
AND drru.created_at >= :start_date::DATE AND drru.created_at <= :end_date::DATE
AND drru.created_at::DATE >= :start_date::DATE AND drru.created_at::DATE <= :end_date::DATE
GROUP BY drr.reaction_value, day
SQL

Expand All @@ -212,7 +212,7 @@ class Engine < ::Rails::Engine
date_trunc('day', pa.created_at)::date as day
FROM post_actions as pa
WHERE pa.post_action_type_id = :likes
AND pa.created_at >= :start_date::DATE AND pa.created_at <= :end_date::DATE
AND pa.created_at::DATE >= :start_date::DATE AND pa.created_at::DATE <= :end_date::DATE
GROUP BY day
SQL
start_date: report.start_date.to_date,
Expand Down