Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validating uniqueness on a edit form broken #38

Closed
donmcclean opened this issue Oct 28, 2014 · 4 comments
Closed

Validating uniqueness on a edit form broken #38

donmcclean opened this issue Oct 28, 2014 · 4 comments
Assignees
Labels

Comments

@donmcclean
Copy link

When I attempt to update an existing record, the uniqueness validation for a field indicates the field
value already is taken. It is not taking into account that the record I am editing is the
one that has the existing value.

@joecorcoran
Copy link
Collaborator

Hmm, sounds bad. I'll try and look into this.

@donmcclean
Copy link
Author

Thanks!

@dannysperry
Copy link
Collaborator

I'm also experiencing this, any ideas on what might be causing this? I'd be happy to look into it and submit a PR.
I'm using:
judge (> 2.0.4)
judge-simple_form (
> 0.4.0)
rails (> 4.1.4)
simple_form (
> 3.0.2)

@dannysperry
Copy link
Collaborator

I ended up "fixing" this by storing the original value of the input in a variable and calling judge on the input if the input value != original value.

I attempted to find where this would be caught inside judge.js, but was a bit overwhelmed. I'd be happy to look deeper and possibly submit a PR if you have any suggestions on where to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants