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

Remove duplicate uniqueness validation on users #125

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

christopherstyles
Copy link

A uniqueness validation for the user email attribute has already been added by the Clearance::User::Validations module in clearance/user.rb#L144-L148. Duplicating the validation rule was resulting in duplicate error responses from the API.

In addition, there is no need to specify a case_sensitive property for the uniqueness validation on non-text columns (the email column type is varchar), as it is ignored.

This update removes the redundant uniqueness validation for user#email, therefore preventing multiple email validation errors that were occurring in API responses.

Closes #108

A uniqueness validation for the user `email` attribute has already been
added by the `Clearance::User::Validations` module in
[clearance/user.rb#L144-L148](https://github.com/thoughtbot/clearance/bl
ob/3e9529a643cff20beb9bb49eacedb90dee49d465/lib/clearance/user.rb#L144-L
148). Duplicating the validation rule was resulting in duplicate error
responses from the API.

In addition, there is no need to specify a `case_sensitive` property
for the uniqueness validation on _non-text_ columns (the email column
type is `varchar`), as it is ignored.

This update removes the redundant uniqueness validation for
`user#email`, therefore preventing multiple email validation errors
that were occurring in API responses.

Closes Bernie-2016#108
@christopherstyles
Copy link
Author

@patrickcousins can I get a review?

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

Successfully merging this pull request may close these issues.

1 participant