Closed ChristofferJoergensen closed 9 years ago
Take a look to this: https://github.com/joecorcoran/judge/issues/25
it was because of the regex itself for me.
Thanks for your comment. But the problem for me is here that devise defines the email regex, and I would really like not to overwrite Devise validation functionality.
This isue too could bring you more information about the issue, maybe your Device gem override the native regex way.
@ChristofferJoergensen , same issue. Did you solve? Thanks
Hi @ricardodovalle. No, I have not yet solved it. I am a little bit afraid of implementing some custom regex override. I feel like I should stick to the validations that Devise has implemented.
Having the exact same issue.
+1 same issue.
+1 same issue for devise validatable, how can we fix.
Same here. Judge mark any email as invalid.
Devise regex: /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
Judge generated regex: (?-mix:\\A[^@\\s]+@([^@\\s]+\\.)+[^@\\s]+\\z)
@ChristofferJoergensen There's nothing magical about Devise's validations, you can see them here: https://github.com/plataformatec/devise/blob/18b6064d74726147eccd69b24812000074261bbb/lib/devise/models/validatable.rb#L29
If you don't want to remove the validatable
module complete, Devise offers a config in their initializer to just override the email regex:
# Email regex used to validate email formats. It simply asserts that
# one (and only one) @ exists in the given string. This is mainly
# to give user feedback and not to assert the e-mail validity.
# config.email_regexp = /\A[^@]+@[^@]+\z/
As you see from the comments (and source here: https://github.com/plataformatec/devise/blob/18b6064d74726147eccd69b24812000074261bbb/lib/devise.rb#L108) their regex is actually pretty weak.
+1 same here with devise
Great gem that you have shared with us!
I am having some problems validating the
email
attribute in myUser
model. I am usingdevise
's validatable module to perform validation of the uniqueness of theemail
as well as some regex validations I guess.When using
judge
on my form, I get back this 'is invalid' error when I enter any email into my form.Any idea why this is?
My initializer:
My js:
My form:
My log:
And when I remove the validatable module from my
User
model, no errors are returned.