avo icon indicating copy to clipboard operation
avo copied to clipboard

[RFC] Delegated types in Avo

Open adrianthedev opened this issue 1 year ago • 1 comments

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:

  1. Do you have an Entry resource?
  2. Do you always create Comments and Messages through an Entry?
  3. Do you only use the Comment and Message resources?
  4. If you're using the Entry resource, how do you handle the form? Do you manually add the fields to the Entry so they are forwarded to the Comment?
  5. Do you use the entryable_type and entryable_id on the Entry resource like the polymorphic belongs_to?
  6. 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.

adrianthedev avatar Apr 10 '24 16:04 adrianthedev

For my own purposes:

  1. 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)
  2. Yes, although I have set up custom actions for both comment and message, because they have different fields
  3. Yes
  4. I don’t use the entry form at all
  5. Yes I have the association configured as a polymorphic belongs to, but I don’t show the two fields anywhere
  6. 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.

iainbeeston avatar Apr 11 '24 06:04 iainbeeston