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: verify type when fetching associations fields #3231

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented Sep 10, 2024

Description

Fixes #3166
Fixes #3158

In the previous attempt #3230, I aimed to target the exact field type when fetching association fields. However, that approach was abandoned as it led down a rabbit hole and was difficult to stabilize. In some cases, identifying the exact field type would require passing it through params, which is not ideal for maintainability and simplicity.

This PR simplifies things by following the 80/20 rule. Instead of trying to pinpoint the exact field type, Avo now just checks if the field is one of the supported associations when fetching fields. This fixes the reported issue and similar ones without overcomplicating things.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@Paul-Bob Paul-Bob self-assigned this Sep 10, 2024
@Paul-Bob Paul-Bob marked this pull request as draft September 10, 2024 09:28
@github-actions github-actions bot added the Fix label Sep 10, 2024
Copy link

codeclimate bot commented Sep 10, 2024

Code Climate has analyzed commit f5d25c6 and detected 0 issues on this pull request.

View more on Code Climate.

@Paul-Bob Paul-Bob changed the title fix: search association field by type and id fix: verify type when fetching associations fields Sep 10, 2024
@Paul-Bob Paul-Bob marked this pull request as ready for review September 11, 2024 05:47
@Paul-Bob Paul-Bob merged commit 5f37ee4 into main Sep 12, 2024
22 checks passed
@Paul-Bob Paul-Bob deleted the fix/search_association_field_by_type_and_id_second_try branch September 12, 2024 12:40
Copy link
Contributor

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants