Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. private regex_social_identification_client = [
  2. /[0-9]{2}.?[0-9]{3}.?[0-9]{3}/?[0-9]{4}-?[0-9]{2}/,
  3. /[0-9]{3}.?[0-9]{3}.?[0-9]{3}-?[0-9]{2}/
  4. ].freeze
  5.  
  6. def format_social_identification_client
  7. return unless regex_social_identification_client.find {
  8. |regex| social_identification_client.format =~ regex
  9. }
  10. errors.add(
  11. :social_identification_client, :invalid, message:
  12. "The CPF/CNPJ does not have a valid format"
  13. )
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement