I’ve got a simple schema Product with many_to_many :tags relation without an intermediate schema for the join table.
many_to_many :tags, Tag, join_through: "products_tags"
Now the question is quite simple, in Ruby’s ActiveRecord, there’s a convenient setter where you can just set to an array of IDs of the associated records, and it will automatically update the join records, ie.:
product.tag_ids = [1, 2, 5, 6]
In Ecto if I want to use
put_assoc, it requires me to preload all the tags in a array, so I can perform
What if I don’t want to preload them, like it’s done in ActiveRecord?