My space on the web https://inhji.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

19 lines
368 B

defmodule Mirage.Links.Link do
use Ecto.Schema
import Ecto.Changeset
alias Mirage.Notes.Note
schema "links" do
field :title, :string
field :url, :string
many_to_many :note, Note, join_through: "notes_links"
end
@doc false
def changeset(link, attrs) do
link
|> cast(attrs, [:title, :url])
|> validate_required([:url])
end
end