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: allow falsey discriminator values #6973

Merged
merged 1 commit into from
Oct 26, 2020

Conversation

imnotjames
Copy link
Contributor

@imnotjames imnotjames commented Oct 26, 2020

Description of change

This allows discriminator values in Single Table Inheritance - such as 0, "", or null

Before, if you attempted to use a discriminator for 0 you'd receive errors about an invalid
discriminator value, or the metadata just wouldn't register correctly.

Now, you can use a discriminator value that's "falsey" but not undefined.

fixes #3891

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change N/A
  • The new commits follow conventions explained in CONTRIBUTING.md

allow discriminator values in Single Table Inheritance
like 0, "", or `null`

fixes typeorm#3891
@imnotjames imnotjames added the hacktoberfest-accepted label hacktoberfest label Oct 26, 2020
@pleerock pleerock merged commit f3ba242 into typeorm:master Oct 26, 2020
dolsup pushed a commit to dolsup/typeorm that referenced this pull request Nov 3, 2020
allow discriminator values in Single Table Inheritance
like 0, "", or `null`

fixes typeorm#3891
zaro pushed a commit to zaro/typeorm that referenced this pull request Jan 12, 2021
allow discriminator values in Single Table Inheritance
like 0, "", or `null`

fixes typeorm#3891
@imnotjames imnotjames deleted the feat/discriminator-value branch June 21, 2021 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted label hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zero as a discriminator value
2 participants