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

camatcode / basenji / a4bf1f5509804ed15c16dac5d914cfac51d46ef1

03 Jul 2025 08:35PM UTC coverage: 57.545% (-0.8%) from 58.297%
a4bf1f5509804ed15c16dac5d914cfac51d46ef1

Pull #20

github

camatcode
feat(collections): crud
Pull Request #20: feat(collections): crud

31 of 57 new or added lines in 4 files covered. (54.39%)

286 of 497 relevant lines covered (57.55%)

160.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/lib/basenji/collection/collection_comic.ex
1
defmodule Basenji.CollectionComic do
2
  @moduledoc false
3

4
  use Ecto.Schema
5

6
  import Ecto.Changeset
7

8
  alias Basenji.Collection
9
  alias Basenji.Comic
10

11
  require Logger
12

13
  schema "collection_comics" do
3,621✔
14
    belongs_to(:collection, Collection, type: Ecto.UUID)
15
    belongs_to(:comic, Comic, type: Ecto.UUID)
16

17
    timestamps(type: :utc_datetime)
18
  end
19

20
  def changeset(collection_comic, attrs \\ %{}) do
21
    collection_comic
22
    |> cast(attrs, [:collection_id, :comic_id])
23
    |> validate_required([:collection_id, :comic_id])
24
    |> foreign_key_constraint(:collection_id)
NEW
25
    |> foreign_key_constraint(:comic_id)
×
26
  end
27
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc