Browse Source

CLDC-4090: Ensure startdate is not nil for this validation

CLDC-4090-validate-end-date-of-LA-ECode
Samuel Young 1 month ago
parent
commit
79750fc91b
  1. 2
      app/models/validations/property_validations.rb
  2. 2
      app/models/validations/sales/property_validations.rb

2
app/models/validations/property_validations.rb

@ -78,7 +78,7 @@ module Validations::PropertyValidations
end
def validate_la_is_active(record)
return unless record.form.start_year_2025_or_later?
return unless record.form.start_year_2025_or_later? && record.startdate.present?
if record.is_general_needs?
return unless record.la

2
app/models/validations/sales/property_validations.rb

@ -56,7 +56,7 @@ module Validations::Sales::PropertyValidations
end
def validate_la_is_active(record)
return unless record.form.start_year_2025_or_later? && record.la.present?
return unless record.form.start_year_2025_or_later? && record.la.present? && record.startdate.present?
la = LocalAuthority.england.find_by(code: record.la)

Loading…
Cancel
Save