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

bamorim / typed_ecto_schema / 35be60cbe71c7f8df755b01621ec8fccfcfb209e
100%

Build:
DEFAULT BRANCH: master
Ran 25 Aug 2026 07:37PM 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

25 Aug 2026 07:37PM UTC coverage: 100.0%. Remained the same
35be60cbe71c7f8df755b01621ec8fccfcfb209e

push

github

web-flow
feat: opt-in named types for Ecto.Enum fields (#39) (#63)

* feat: opt-in named types for Ecto.Enum fields (#39)

Add an opt-in `additional_types` schema-level option to typed_schema
and typed_embedded_schema. When enabled, each Ecto.Enum field defines a
public named type with the union of its values (union of atom keys for
keyword values, element union for {:array, Ecto.Enum}), so it can be
referenced from other modules' specs as MySchema.field_name().

Fields named t and fields whose values can't be resolved to a list of
atoms are silently skipped. Also add a fallback clause to
disjunction_typespec/1 so unresolvable values fall back to any()
instead of raising.

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

* docs: mark additional_types as experimental

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

* feat: global config opt-in and named types for polymorphic embeds

Allow enabling additional_types globally via compile-time application
config (config :typed_ecto_schema, additional_types: true), with the
schema-level option taking precedence in both directions, following the
same Application.compile_env pattern as the polymorphic_embed flag.

When both the PolymorphicEmbed integration and additional_types are
enabled, polymorphic_embeds_one/many fields also emit a named type with
the union of the modules in their :types option, reusing the union AST
the syntax sugar already builds (skipping the any() fallback for
unresolvable types and fields named t).

Rename the internal enum_types accumulator to additional_types since it
is no longer enum-only.

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

* test: cover non-atom enum values in the additional type guard

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

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

24 of 24 new or added lines in 1 file covered. (100.0%)

171 of 171 relevant lines covered (100.0%)

26.77 hits per line

Jobs
ID Job ID Ran Files Coverage
1 35be60cbe71c7f8df755b01621ec8fccfcfb209e.1 25 Aug 2026 07:37PM UTC 5
100.0
GitHub Action Run
Source Files on build 35be60cbe71c7f8df755b01621ec8fccfcfb209e
  • Tree
  • List 5
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 35be60cb on github
  • Prev Build on master (#8D27DDD9...)
  • Next Build on master (#940FE547...)
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