Move to method

This commit is contained in:
Jorge Manrubia
2025-04-24 16:27:19 +02:00
parent b5737ee9ed
commit 4aedb70e70
@@ -4,7 +4,7 @@ module DayTimelinesScoped
included do
include FilterScoped
before_action :clear_collections_filter, if: -> { params[:clear_filter] }
before_action :clear_collections_filter, if: :clear_collections_filter?
before_action :restore_collections_filter
before_action :set_day_timeline
@@ -16,6 +16,10 @@ module DayTimelinesScoped
cookies.delete(:collection_filter)
end
def clear_collections_filter?
params[:clear_filter]
end
def restore_collections_filter
if cookies[:collection_filter].present?
@filter.collection_ids = cookies[:collection_filter].split(",")