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

mathieuprog / polymorphic_embed / 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148
86%
master: 83%

Build:
Build:
LAST BUILD BRANCH: fix-embeds-cast-and-forms
DEFAULT BRANCH: master
Ran 23 Oct 2026 12:34PM UTC
Jobs 8
Files 6
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

23 Oct 2026 12:33PM UTC coverage: 85.497% (+2.6%) from 82.933%
322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148

Pull #148

github

nduitz
Add put_polymorphic_embed/3

When the cast puts changesets into the changes of a polymorphic field,
the field has an Ecto embed type with one schema module. Ecto's
put_change/3, update_change/3 and change/2 then check each child against
that module, so they raise for children of another type. Ecto has no
place where polymorphic_embed can change that check.

put_polymorphic_embed/3 works as Ecto.Changeset.put_embed/4, but it finds
the matching data row by module and primary key, per element. So a list
can hold more than one type, and a single embed can change its type. It
accepts structs, changesets, maps and keyword lists. The type of a map
comes from its type field, from the data row with the same primary key,
or from the only type of the field. A new child gets its id at once, as
in the cast.

The changelog lists the new function, and the limit of Ecto's functions
as a breaking change.

The function keeps the changeset function that an earlier cast stored
for the forms, for example a with: function. An empty list replaces
data that holds only entries from the load options. The tests also
check that ordinary embeds in the data of a put child get their ids on
insert, and that the form keeps the id of a struct that the caller
gives.
Pull Request #148: Ecto parity

248 of 283 new or added lines in 4 files covered. (87.63%)

9 existing lines in 1 file now uncovered.

507 of 593 relevant lines covered (85.5%)

518.26 hits per line

Uncovered Changes

Lines Coverage ∆ File
17
87.65
4.45% lib/polymorphic_embed.ex
16
68.63
lib/polymorphic_embed/embedded.ex
1
95.08
2.06% lib/polymorphic_embed/html/helpers.ex
1
58.06
3.23% lib/polymorphic_embed/options_validator.ex

Coverage Regressions

Lines Coverage ∆ File
9
87.65
4.45% lib/polymorphic_embed.ex
Jobs
ID Job ID Ran Files Coverage
1 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148.1 23 Oct 2026 12:34PM UTC 6
85.5
GitHub Action Run
2 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148.2 23 Oct 2026 12:34PM UTC 6
85.5
GitHub Action Run
3 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148.3 23 Oct 2026 12:34PM UTC 6
85.5
GitHub Action Run
4 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148.4 23 Oct 2026 12:34PM UTC 6
85.5
GitHub Action Run
5 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148.5 23 Oct 2026 12:34PM UTC 6
85.5
GitHub Action Run
6 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148.6 23 Oct 2026 12:34PM UTC 6
85.5
GitHub Action Run
7 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148.7 23 Oct 2026 12:34PM UTC 6
85.5
GitHub Action Run
8 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148.8 23 Oct 2026 12:34PM UTC 6
85.5
GitHub Action Run
Source Files on build 322096bedd8bcf6bd7fd326c89303c5e72fedc16-PR-148
  • Tree
  • List 6
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #148
  • PR Base - master (#6AA26ED7...)
  • Delete
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