avo
avo copied to clipboard
[RFC] Delegated types in Avo
Feature
I keep bragging that we support all Rails' associations, but it seems that we don't have such a great support for delegated types.
I haven't used them in an app but I know there are a couple of folks that are using DT but I'd like to know how are you using it.
Let's take the Entry and Comment/Message examples that Rails offers in the docs.
Some questions that pop to mind:
- Do you have an
Entryresource? - Do you always create
Comments andMessages through anEntry? - Do you only use the
CommentandMessageresources? - If you're using the
Entryresource, how do you handle the form? Do you manually add the fields to theEntryso they are forwarded to theComment? - Do you use the
entryable_typeandentryable_idon theEntryresource like the polymorphic belongs_to? - If yes, have you built that manually using fields?
Besides the question, please describe your use case as loose or as detailed (I prefer detailed) as possible.
I'd like to know what the pain points are and how we could solve them.
For my own purposes:
- Yes. The way I have it set up, other resources have an “entries” association. The entry resource only really has an association and index view though (I block the other views with a policy)
- Yes, although I have set up custom actions for both comment and message, because they have different fields
- Yes
- I don’t use the entry form at all
- Yes I have the association configured as a polymorphic belongs to, but I don’t show the two fields anywhere
- No
I think some people might have common fields on the entry that they want to show, even if I don’t need to do that.