polymorphic_embed icon indicating copy to clipboard operation
polymorphic_embed copied to clipboard

Fix get type

Open woylie opened this issue 3 years ago • 8 comments

resolves #63

To cover all cases, I had to add channel2 and channel3 fields to the reminder schema.

  • channel: identity_by_fields and type_field
  • channel2: none of these options
  • channel3: only type_field

If the field passed to the function is an array field, the function will return nil, since the type can only be determined by looking at a single item.

I found another related issue while looking into this, I'll open another PR for that.

I added dialyzer and excoveralls to the project, I hope you don't mind.

woylie avatar Oct 09 '22 09:10 woylie

Please merge #71 first.

woylie avatar Oct 20 '22 05:10 woylie

@mathieuprog This is ready for review. I split the workflow to run the tests in the matrix, but the remaining steps only with the latest Elixir version. The CI job from the last PR failed because the formatter did different things in different versions.

woylie avatar Nov 13 '22 06:11 woylie

I'll review this as soon as I have some alone-time!

mathieuprog avatar Nov 13 '22 07:11 mathieuprog

This also fixes an issue I'm seeing where get_polymorphic_type returns nil when a map is passed (happens in a nested form).

SteffenDE avatar Dec 06 '22 13:12 SteffenDE

@mathieuprog I don't want to rush you, but is there a chance to get this merged soon?

woylie avatar Feb 17 '23 03:02 woylie

Sorry I'll get to it in coming days

mathieuprog avatar Feb 19 '23 17:02 mathieuprog

Just wanted to give this a little bump. I'm currently affected by this bug. Please let me know if there's anything I can do to help this PR along.

AHBruns avatar Mar 10 '23 17:03 AHBruns

Also here to bump.

sodapopcan avatar Jul 11 '23 15:07 sodapopcan