Files
fizzy/app/controllers/concerns/day_timelines_scoped.rb
T
Jorge Manrubia 5896a21499 Support filter by collection in different screens
We want to filter in the same screen for cards/events but not when viewing a card or from other screens. This adds a controller action to flag the actions where this is supported
2025-08-21 14:19:13 +02:00

25 lines
438 B
Ruby

module DayTimelinesScoped
extend ActiveSupport::Concern
included do
include FilterScoped
before_action :set_day_timeline
end
private
def set_day_timeline
@day_timeline = Current.user.timeline_for(day, filter: @filter)
end
def day
if params[:day].present?
Time.zone.parse(params[:day])
else
Time.current
end
rescue ArgumentError
head :not_found
end
end