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

Clarification on description for :validate_uniqueness #765

Open
Nick-t-go opened this issue Feb 4, 2022 · 3 comments
Open

Clarification on description for :validate_uniqueness #765

Nick-t-go opened this issue Feb 4, 2022 · 3 comments

Comments

@Nick-t-go
Copy link

Nick-t-go commented Feb 4, 2022

In the docs under options section, it states for :validate_uniqueness:

Whether or not to run uniqueness validations, has potential pitfalls, use with caution (requires >= v0.27.0).

I'm assuming it means active record uniqueness validations. Is that what it means? If so can the text be changed to (I can open a PR if accepting community submissions):

Whether or not to run ActiveRecord uniqueness validations, has potential pitfalls, use with caution (requires >= v0.27.0).

This way it is consistent with the :validate description which explicitly states:

Whether or not to run ActiveRecord validations (uniqueness skipped). This option will always be true when using import!.

If this doesn't refer to active record uniqueness validations then this is not an issue and explicitly omitting ActiveRecord was intentional and I am just implying otherwise on my own.

@jkowens
Copy link
Collaborator

jkowens commented Feb 5, 2022

Yes :validate_uniqueness is for ActiveRecord validations.

@Drew-Goddyn
Copy link

Possible to also add clarification for what the pitfalls are? They don't appear to be mentioned in the rest of readme.

@jkowens
Copy link
Collaborator

jkowens commented Mar 6, 2022

Using :validate_uniqueness will require a sql query per record...so it is basically N+1 queries.

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

No branches or pull requests

3 participants