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

Repurpose BelongsToPresenceChecker to check for foreign key presence in the DB #94

Closed
pirj opened this issue Oct 23, 2021 · 1 comment
Closed

Comments

@pirj
Copy link
Contributor

pirj commented Oct 23, 2021

Problem

BelongsToPresenceChecker shouldn't care if an association has required: true because any non-polymorphic belongs_to should have foreign keys and nulls are okay with that.

We have to rename the checker as it simply does slightly different than "belongs_to presence".

Suggested approach

  1. Make BelongsToPresenceChecker to be derived from AssociationChecker and check if belongs_to has a foreign key.
  2. Rename the checker.

As discussed here

@djezzzl
Copy link
Owner

djezzzl commented Oct 26, 2021

A fix is here: #99.

@djezzzl djezzzl closed this as completed Oct 26, 2021
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