Update Residence validation

- Update residence_valid? method to don't check :year_of_birth
when :date_of_birth is present.
- Remove unused 'census_year_of_birth' method.
This commit is contained in:
taitus
2019-04-25 17:04:55 +02:00
committed by Javi Martín
parent cc49587fe4
commit ff1e8db4c6

View File

@@ -117,12 +117,12 @@ class Officing::Residence
end
def residency_valid?
@census_api_response.valid? &&
@census_api_response.date_of_birth.year.to_s == year_of_birth.to_s
@census_api_response.valid? && valid_year_of_birth?
end
def census_year_of_birth
@census_api_response.date_of_birth.year
def valid_year_of_birth?
return true if Setting.force_presence_date_of_birth?
@census_api_response.date_of_birth.year.to_s == year_of_birth.to_s
end
def clean_document_number