Browse Source

rename method

pull/411/head
Kat 3 years ago
parent
commit
63da3cea83
  1. 3
      app/models/case_log.rb
  2. 2
      app/models/validations/financial_validations.rb

3
app/models/case_log.rb

@ -48,7 +48,7 @@ class CaseLog < ApplicationRecord
FormHandler.instance.get_form(form_name) || FormHandler.instance.forms.first.second
end
def get_collection_start_year
def collection_start_year
window_end_date = Time.zone.local(startdate.year, 4, 1)
startdate < window_end_date ? startdate.year - 1 : startdate.year
end
@ -56,7 +56,6 @@ class CaseLog < ApplicationRecord
def form_name
return unless startdate
collection_start_year = get_collection_start_year
"#{collection_start_year}_#{collection_start_year + 1}"
end

2
app/models/validations/financial_validations.rb

@ -135,7 +135,7 @@ private
def validate_rent_range(record)
return if record.startdate.blank?
collection_year = record.get_collection_start_year
collection_year = record.collection_start_year
rent_range = LaRentRange.find_by(start_year: collection_year, la: record.la, beds: record.beds, lettype: record.lettype)
if rent_range.present? && !weekly_value_in_range(record, "brent", rent_range.hard_min, rent_range.hard_max)

Loading…
Cancel
Save