avo
avo copied to clipboard
`link_to_record` should override link to association or throw warning
Describe the bug
Given
class Avo::Resources::Example < Avo::BaseResource
def fields
field :type,
as: :belongs_to,
link_to_record: true
end
end
still links to the Type association, not to the Example record.
Steps to Reproduce
- Add
link_to_record: trueto abelongs_totype - Try to click the link
- You end up on the association, not the record
Expected behavior & Actual behavior
It should either override the link to association or throw a warning.
System configuration
Avo version: 3.6.1
Rails version: 7.0.8.1
Ruby version: 3.2.3
License type:
- [x] Community
- [ ] Pro
- [ ] Advanced
Are you using Avo monkey patches, overriding views or view components?
- [ ] Yes. If so, please post code samples.
- [x] No
Impact
- [ ] High impact (It makes my app un-usable.)
- [ ] Medium impact (I'm annoyed, but I'll live.)
- [x] Low impact (It's really a tiny thing that I could live with.)
Urgency
- [ ] High urgency (I can't continue development without it.)
- [ ] Medium urgency (I found a workaround, but I'd love to have it fixed.)
- [x] Low urgency (It can wait. I just wanted you to know about it.)
Yeah, we wrote in the docs that that option is available only on the id, text, and gravatar fields.
I understand your feedback that it should raise a warning, but we don't yet have a mechanism to mark fields which universal options they support.
TBH, we'd welcome a PR to support link_to_record on belongs_to. I could see that being helpful.
Approach
Sorry, I missed that. I'll try a PR to make it work.
This issue has been marked as stale because there was no activity for the past 15 days.
This issue has been marked as stale because there was no activity for the past 15 days.
This issue has been marked as stale because there was no activity for the past 15 days.
Closing this because there was no activity for the past 15 days. Feel free to reopen if new information pops up ✌️