Extract component to render the date of birth
We reduce code duplication thanks to that, and make it easier to change this field. Note that there was one place where the "16.years" value was hardcoded. We're moving the test for this case to the component and changing it so the test doesn't use the default age. We're also removing the redundant helper method that had the same code as a method in the User class which is called everywhere else.
This commit is contained in:
@@ -5,10 +5,6 @@ module VerificationHelper
|
||||
[t("verification.residence.new.document_type.residence_card"), 3]]
|
||||
end
|
||||
|
||||
def minimum_required_age
|
||||
(Setting["min_age_to_participate"] || 16).to_i
|
||||
end
|
||||
|
||||
def mask_phone(number)
|
||||
match = number.match(/\d{3}$/)
|
||||
"******#{match}"
|
||||
|
||||
Reference in New Issue
Block a user