From 13e9434f8e958e6bef6ad5d935b356061f2ad88d Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Tue, 6 Feb 2024 10:49:05 +0000 Subject: [PATCH] feat: time travel for PO without breaking tests --- app/controllers/application_controller.rb | 6 ------ app/helpers/filters_helper.rb | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 40a328d80..a68b55f8d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,16 +1,10 @@ class ApplicationController < ActionController::Base - require 'timecop' include Pundit::Authorization rescue_from Pundit::NotAuthorizedError, with: :render_not_authorized before_action :check_maintenance_status before_action :set_paper_trail_whodunnit - before_action :time_travel_for_po - - def time_travel_for_po - Timecop.travel(Time.zone.local(2024,4,1)) - end def check_maintenance_status if FeatureToggle.service_moved? diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 8841a0d36..221dbefca 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -1,5 +1,6 @@ module FiltersHelper include CollectionTimeHelper + require "timecop" def filter_selected?(filter, value, filter_type) return false unless session[session_name_for(filter_type)] @@ -95,6 +96,9 @@ module FiltersHelper end def collection_year_options + current_collection_start_year = 2024 + previous_collection_start_year = 2023 + archived_collection_start_year = 2022 { current_collection_start_year.to_s => year_combo(current_collection_start_year), previous_collection_start_year.to_s => year_combo(previous_collection_start_year),