• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bamorim / typed_ecto_schema / 8d27ddd9065b736800218019aae34b48bf9d0bf0
100%

Build:
DEFAULT BRANCH: master
Ran 24 Aug 2026 11:04AM UTC
Jobs 1
Files 5
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Aug 2026 11:04AM UTC coverage: 100.0% (+7.0%) from 93.043%
8d27ddd9065b736800218019aae34b48bf9d0bf0

push

github

web-flow
feat: support polymorphic_embed's polymorphic_embeds_one/many (#40) (#64)

* feat: support polymorphic_embed's polymorphic_embeds_one/many (#40)

Intercept polymorphic_embeds_one/2 and polymorphic_embeds_many/2 calls in
the syntax sugar, matching purely on the call name so polymorphic_embed
never becomes a dependency of this library. The typespec is inferred as
the union of the modules listed in the :types option (supporting both the
`name: Module` and `name: [module: Module, ...]` forms), falling back to
any() when the types are not statically resolvable. The original call is
re-emitted untouched (minus our :null/:enforce/:: options) so the real
macro still runs.

The ::/:null/:enforce options work the same way they do for field/3.

Also removes a field_is_nullable?/3 clause that was already unreachable
(fully shadowed by the @schema_many_function_name clause) and now triggers
a redundant-clause warning on recent Elixir versions.

polymorphic_embed is added as a test-only dependency for the integration
tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test: cover remaining branches, bringing coverage to 100%

Covers the new polymorphic-embed edge paths (atom module in :types,
unresolvable module/entry fallbacks to any(), non-literal opts left
untouched) plus previously uncovered branches in the files touched by
the previous commit: field/3 with opts and a :: override, composite
{:array, _}/{:map, _} types, evaluated-atom and unknown Ecto types, and
the non-atom field name error in TypeBuilder.add_field/5.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat: gate polymorphic_embed support behind a compile-time flag

The integration matches polymorphic_embeds_one/2 and
polymorphic_embeds_many/2 purely by name, so another library defining
same-named macros with different behavior would break: we would strip
its :null/:enforce options and register a possibly-wrong field type,
and the :: override can only fix the type, not the ... (continued)

33 of 33 new or added lines in 3 files covered. (100.0%)

147 of 147 relevant lines covered (100.0%)

25.37 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8d27ddd9065b736800218019aae34b48bf9d0bf0.1 24 Aug 2026 11:04AM UTC 5
100.0
GitHub Action Run
Source Files on build 8d27ddd9065b736800218019aae34b48bf9d0bf0
  • Tree
  • List 5
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8d27ddd9 on github
  • Prev Build on master (#547BE5A1...)
  • Next Build on master (#35BE60CB...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc