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

Fix strict loading on validations #40775

Merged

Conversation

eileencodes
Copy link
Member

We don't want strict loading to throw an error on validations since
those need to load the record in order to validate it.

This change check the owners's validation_context. If it's nil then
we know we're not currently validating an object in create/update. If
it's set then we're validating and want to skip raising for strict
loading.

Fixes: #40767

We don't want strict loading to throw an error on validations since
those need to load the record in order to validate it.

This change check the owners's `validation_context`. If it's `nil` then
we know we're not currently validating an object in create/update. If
it's set then we're validating and want to skip raising for strict
loading.

Fixes: rails#40767
@eileencodes eileencodes merged commit 46337fa into rails:master Dec 9, 2020
@eileencodes eileencodes deleted the fix-strict-loading-on-validations branch December 9, 2020 19:34
rafaelfranca pushed a commit that referenced this pull request Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strict loading issue for internal queries
2 participants