Browse Source

Rubocop

pull/570/head
Ted 3 years ago committed by Dushan Despotovic
parent
commit
7e7a5aae54
  1. 5
      app/models/case_log.rb
  2. 1
      app/models/validations/soft_validations.rb
  3. 2
      spec/models/case_log_spec.rb

5
app/models/case_log.rb

@ -383,11 +383,12 @@ class CaseLog < ApplicationRecord
end
def retirement_age_for_person(person_num)
gender = public_send("sex#{person_num}".to_sym)
gender = public_send("sex#{person_num}".to_sym)
return unless gender
RETIREMENT_AGES[gender]
end
private
PIO = Postcodes::IO.new

1
app/models/validations/soft_validations.rb

@ -69,6 +69,7 @@ private
economic_status = public_send("ecstat#{person_num}")
gender = public_send("sex#{person_num}")
return unless age && economic_status && gender
%w[M X].include?(gender) && !tenant_is_retired?(economic_status) && age > 67 ||
gender == "F" && !tenant_is_retired?(economic_status) && age > 60
end

2
spec/models/case_log_spec.rb

@ -1956,4 +1956,4 @@ RSpec.describe CaseLog do
end
end
end
end
end

Loading…
Cancel
Save