Browse Source

refactor: revert unnecessary change

pull/1225/head
natdeanlewissoftwire 2 years ago
parent
commit
cd9d0a3755
  1. 12
      app/models/log.rb

12
app/models/log.rb

@ -31,18 +31,10 @@ class Log < ApplicationRecord
def collection_start_year def collection_start_year
return @start_year if @start_year return @start_year if @start_year
if lettings?
return unless startdate return unless startdate
log_start_date = startdate window_end_date = Time.zone.local(startdate.year, 4, 1)
else @start_year = startdate < window_end_date ? startdate.year - 1 : startdate.year
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
end end
def lettings? def lettings?

Loading…
Cancel
Save