rom-sql
rom-sql copied to clipboard
Inconsistent behaviour for changests
Hi,
I have the following simple relations, a user has many tasks throught users_tasks. The following code in the UserRepo will work fine
user1 = users.changeset(:create, new_users.first)
command = users.combine(:users_tasks).command(:create)
command.(user1)
If I try to add multiple users it will fail:
user1 = users.changeset(:create, new_users.first)
user2 = users.changeset(:create, new_users.last)
command = users.combine(:users_tasks).command(:create)
command.([user1, user2])
Even further it will fail if I only pass a single element to the array:
user1 = users.changeset(:create, new_users.first)
command = users.combine(:users_tasks).command(:create)
command.([user1])