ecto_nested_changeset
ecto_nested_changeset copied to clipboard
add functions for changing order
- [ ]
swap([:pets, 3], 5) - [ ]
move_up([:pets, 3]) - [ ]
move_down([:pets, 3]) - [ ]
move_to([:pets, 3], 5])
how do we swap one pet's toys with another pet's toys at specific positions
[%Pet{id: 1, toys: [a, b]}, %Pet{id: 2, toys: [c, d]}]
Probably swap([:owners, 2, :pets, 3], [:owners, 4, :pets, 1]).