Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private regex_social_identification_client = [
- /[0-9]{2}.?[0-9]{3}.?[0-9]{3}/?[0-9]{4}-?[0-9]{2}/,
- /[0-9]{3}.?[0-9]{3}.?[0-9]{3}-?[0-9]{2}/
- ].freeze
- def format_social_identification_client
- return unless regex_social_identification_client.find {
- |regex| social_identification_client.format =~ regex
- }
- errors.add(
- :social_identification_client, :invalid, message:
- "The CPF/CNPJ does not have a valid format"
- )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement