From cd9d0a375580b2314b894df3bfa24c26adc70670 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Thu, 26 Jan 2023 16:20:02 +0000 Subject: [PATCH] refactor: revert unnecessary change --- app/models/log.rb | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/models/log.rb b/app/models/log.rb index 8d9a58913..6aa8569f5 100644 --- a/app/models/log.rb +++ b/app/models/log.rb @@ -31,18 +31,10 @@ class Log < ApplicationRecord def collection_start_year return @start_year if @start_year - if lettings? - return unless startdate + return unless startdate - log_start_date = startdate - else - return unless saledate - - log_start_date = saledate - end - - window_end_date = Time.zone.local(log_start_date.year, 4, 1) - @start_year = log_start_date < window_end_date ? log_start_date.year - 1 : log_start_date.year + window_end_date = Time.zone.local(startdate.year, 4, 1) + @start_year = startdate < window_end_date ? startdate.year - 1 : startdate.year end def lettings?