-
Notifications
You must be signed in to change notification settings - Fork 34
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
Foreign Key checking even for belongs_to #31
Comments
That seems odd. schema_validations emits calls to rails' builtin validators, such as My suggestion is to start by grep'ing the log file for But if the problem isn't obvious, then In fact I'd suggest temporarily copying the validations listed in the log file into your model and disabling |
Ok. I'll spin up a small test app (rather than our monolith) and test this out at a smaller scale. Make sure there's not something else in the mix. I'll let you know what I find. |
@jhirbour any update on this? (Trying to tidy up the list of outstanding issues :) Thanks |
Sorry I've switched jobs. Never got around to reproducing this. |
I'm not sure if this is a bug or a feature and I'm looking for some clarification.
I've got a rails model in our data warehouse that will record deletions of assignments. Because of this I've purposefully NOT added a FK constraint in PG.
Expectation: I expected schema_validations to just validate the presence of assignment_id instead of checking that the assignment_id is valid.
Actual: During execution the assignment row is deleted first and THEN I'm calling DataWarehouse::AssignmentDestroy.create() . The create fails with a validation that assignment can't be blank. From my testing it looks like it's actually testing that the assignment id is valid, NOT that is just exists.
Is this expected behavior?
The text was updated successfully, but these errors were encountered: