Browse Source

Remove fixed term tenancy validation for periodic

pull/2214/head
Kat 2 years ago
parent
commit
d58aff7eb8
  1. 5
      app/models/lettings_log.rb
  2. 2
      app/models/validations/tenancy_validations.rb

5
app/models/lettings_log.rb

@ -345,6 +345,11 @@ class LettingsLog < Log
tenancy == 4 tenancy == 4
end end
def is_periodic_tenancy?
# 8: Periodic
tenancy == 8
end
def is_internal_transfer? def is_internal_transfer?
# 1: Internal Transfer # 1: Internal Transfer
referral == 1 referral == 1

2
app/models/validations/tenancy_validations.rb

@ -24,7 +24,7 @@ module Validations::TenancyValidations
] ]
rent_type_independent_conditions = [ rent_type_independent_conditions = [
{ {
condition: !(record.is_secure_tenancy? || record.is_assured_shorthold_tenancy?) && is_present, condition: !(record.is_secure_tenancy? || record.is_assured_shorthold_tenancy? || record.is_periodic_tenancy?) && is_present,
error: I18n.t("validations.tenancy.length.fixed_term_not_required"), error: I18n.t("validations.tenancy.length.fixed_term_not_required"),
}, },
] ]

Loading…
Cancel
Save