mathieuprog / polymorphic_embed

Polymorphic embeds in Ecto
Apache License 2.0
325 stars 63 forks source link

Fix get type #66

Closed woylie closed 4 months ago

woylie commented 1 year ago

resolves #63

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

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 commented 1 year ago

Please merge #71 first.

woylie commented 1 year ago

@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.

mathieuprog commented 1 year ago

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

SteffenDE commented 1 year ago

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

woylie commented 1 year ago

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

mathieuprog commented 1 year ago

Sorry I'll get to it in coming days

AHBruns commented 1 year ago

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.

sodapopcan commented 1 year ago

Also here to bump.