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

Allow calling generate_uid on before_validation #22

Open
phuibonhoa opened this issue Dec 14, 2022 · 1 comment
Open

Allow calling generate_uid on before_validation #22

phuibonhoa opened this issue Dec 14, 2022 · 1 comment

Comments

@phuibonhoa
Copy link

It would be nice to be able to set validations on the unique id column. Letting someone set the callback to be before_validation instead of before_create means you are guaranteed to have the unique ID set so that validations can be run. Likewise, it makes it easier to backfill or update records that already exist since you can simply set the column to nil before saving to update it.

Right now since it is on before_create there is no way to have validations on the column.

@equivalent
Copy link
Owner

equivalent commented Dec 16, 2022

hi @phuibonhoa interesting point, please give me couple of weeks to think about this 🤔. ..I'm bit overwhelmed at the moment with some circumstances . I'll address this ASAP

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

2 participants