5896a21499
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
25 lines
438 B
Ruby
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
|