-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
ID field within has_many field does not link to child resource #2782
Comments
Thanks @cyu! |
Related to #2651 |
I did look into this a bit, and the issue seems to be how |
Ok. That might be the fix! |
@adrianthedev I can give it a shot, but I need some guidance on how to navigate to the parent has_many field in that scenario. |
Hey @cyu can you please confirm if it works or not on the demo website? I think I see it working. CleanShot.2024-05-21.at.22.36.58.mp4 |
@adrianthedev It works from the People index view; where it doesn't work is from a child view. For example, if you add to Person |
Can you please create a reproduction repo so we can test it out? |
The issue arises when you create a |
Hi, @cyu! I did some more digging and managed to reproduce the bug you were describing. that bug is fixed in Avo 3. Avo 2 is not receiving any more bug fixes, but only security fixes. |
I will close this to keep the issue queue clean. Let me know if there's anything else I can help with. |
@gabrielgiroe1 What version of Avo 3 is this in? My repro example was done in Avo 3.7.4 Please re-review this issue and the example repro project. I don't believe this is solved. It doesn't make sense that the ID link had the view link would behave differently in this case. |
I misunderstood that it would be on Avo 2. We will look to check if it is fixed. |
This issue has been marked as stale because there was no activity for the past 15 days. |
Describe the bug
The ID field within a
has_many
field always links to the base class resource even whenlink_to_child_resource
is true.Steps to Reproduce
Steps to reproduce the behavior:
Consider having the setup in the STI example here: https://docs.avohq.io/2.0/associations.html#link-to-child-resource-when-using-sti
avo.rb
initializer, enableid_links_to_resource
:config.id_links_to_resource = true
peoples
fieldExpected behavior & Actual behavior
When you click on the linked ID column, the expectation is that it will take you to the show page of the child resource (SpouseResource or SiblingResource). Instead it takes you to the base class resource (PersonResoure). If you use the View icon button, it will actually take you to the correct child record.
System configuration
Avo version: 3.3.2
Rails version: 7.1 3
Ruby version: 3.2.2
License type:
Are you using Avo monkey patches, overriding views or view components?
Screenshots or screen recordings
Additional context
Impact
Urgency
The text was updated successfully, but these errors were encountered: