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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user