From 4992cb379af9cd3af47c7647679bc0f2b94a62ee Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 18 Feb 2026 18:12:32 +0530 Subject: [PATCH] refactor: remove redundant scan --- .../v2/reports/concerns/rollup_conditions.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/builders/v2/reports/concerns/rollup_conditions.rb b/app/builders/v2/reports/concerns/rollup_conditions.rb index 50781b4d2..aae87e8f8 100644 --- a/app/builders/v2/reports/concerns/rollup_conditions.rb +++ b/app/builders/v2/reports/concerns/rollup_conditions.rb @@ -47,18 +47,8 @@ module V2::Reports::Concerns::RollupConditions def timezone_matches_account? return true if params[:timezone_offset].blank? - account_timezone = account.reporting_timezone offset_in_seconds = params[:timezone_offset].to_f * 3600 - - # Find the timezone that matches the offset - matching_zone = ActiveSupport::TimeZone.all.find do |zone| - zone.now.utc_offset == offset_in_seconds - end - - return false if matching_zone.blank? - - # Convert account timezone to current UTC offset and compare - account_zone = ActiveSupport::TimeZone[account_timezone] + account_zone = ActiveSupport::TimeZone[account.reporting_timezone] account_zone&.now&.utc_offset == offset_in_seconds end