From 5a4d2a72c89d112d6be18319785aebf157be1f71 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 24 Feb 2025 17:01:43 -0600 Subject: [PATCH] Remove uniqueness constraint I'm not sure if this was inadvertent or an artifact of an earlier design but I'm fairly certain we want a more comprehensive list of events here. Especially comments, for example. We should show all the comments that happen in a particular hour on the timeline. There may be places were we need to dial back but for now I'm going to lift the constraint and see how it feels. --- app/controllers/events_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 758db65c1..d8b14fc40 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -5,15 +5,15 @@ class EventsController < ApplicationController def index update_bucket_filter @buckets = Current.user.buckets.alphabetically - @events = unique_events_by_hour_and_column + @events = events_by_hour_and_column @next_day = latest_event_before_today&.created_at end private - def unique_events_by_hour_and_column + def events_by_hour_and_column user_events.where(created_at: @activity_day.all_day). group_by { |event| [ event.created_at.hour, helpers.event_column(event) ] }. - map { |hour_col, events| [ hour_col, events.uniq(&:bubble_id) ] } + map { |hour_col, events| [ hour_col, events ] } end def latest_event_before_today