S
def update_tag_spots(%Tag{} = tag, spots \\ []) when is_list(spots) do
tag
|> Tag.spots_changeset(spots)
|> Repo.update()
endSize: a a a
S
def update_tag_spots(%Tag{} = tag, spots \\ []) when is_list(spots) do
tag
|> Tag.spots_changeset(spots)
|> Repo.update()
endS
unique_constraintLL
unique_constraintecto с MyXQL неправильно обрабаывают эту ошибку. Сделай issueS
S
ERROR 23505 (unique_violation) duplicate key value violates unique constraint "tags_spots_tag_id_spot_id_index"S
LL
V
_
D
V
LL
elm и pandoc. Ещё есть xmonad. КонецLL
_
_
S
- many_to_many :spots, Spot, join_through: "tags_spots", on_replace: :delete
+ many_to_many :spots, Spot, join_through: TagSpot, on_replace: :delete
LL
- many_to_many :spots, Spot, join_through: "tags_spots", on_replace: :delete
+ many_to_many :spots, Spot, join_through: TagSpot, on_replace: :delete
S
join_through - Atom (representing a schema) or a string (representing a table) for many to many associationsSK
LL
ifchangeset-е