mathieuprog / polymorphic_embed

Polymorphic embeds in Ecto
Apache License 2.0
340 stars 62 forks source link

Fix get type #66

Closed woylie closed 7 months ago

woylie commented 2 years 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 2 years ago

Please merge #71 first.

woylie commented 2 years 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 2 years 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.