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

Add nil check to cast_polymorphic_embeds_many #106

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

clinejj
Copy link
Contributor

@clinejj clinejj commented Jul 17, 2024

Add a nil check for changes introduced in 9bc13e2 that supported maintaining IDs

Fixes #105

@mathieuprog
Copy link
Owner

Can we just do:

list_data_for_field = Map.fetch!(changeset.data, field) || []

Cause the variable says list_ so we can expect a list.

@clinejj
Copy link
Contributor Author

clinejj commented Jul 18, 2024

@mathieuprog yep, that's a lot cleaner - updated with that change

@coveralls
Copy link

coveralls commented Jul 18, 2024

Pull Request Test Coverage Report for Build cef782eca8b2df3a9cabc5a15e3834c28019d9cd-PR-106

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 83.008%

Totals Coverage Status
Change from base Build c57a335e2918b4d5e97af61d030f92dc44255fae: 0.0%
Covered Lines: 298
Relevant Lines: 359

💛 - Coveralls

1 similar comment
@coveralls
Copy link

coveralls commented Jul 18, 2024

Pull Request Test Coverage Report for Build cef782eca8b2df3a9cabc5a15e3834c28019d9cd-PR-106

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 83.008%

Totals Coverage Status
Change from base Build c57a335e2918b4d5e97af61d030f92dc44255fae: 0.0%
Covered Lines: 298
Relevant Lines: 359

💛 - Coveralls

@mathieuprog mathieuprog merged commit 68e54e0 into mathieuprog:master Jul 18, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

Enum.find error when applying a changeset to a nil field in 4.x
3 participants