# Setting an association by passing tuple rather than id

**URL:** <https://discourse.rom-rb.org/t/setting-an-association-by-passing-tuple-rather-than-id/528>\
**Category:** Issues\
**Created:** [April 14, 2022, 3:25pm UTC](https://discourse.rom-rb.org/t/setting-an-association-by-passing-tuple-rather-than-id/528 "2022-04-14T15:25:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeslinger](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@codeslinger](https://discourse.rom-rb.org/u/codeslinger)\
**Post date:** [April 14, 2022, 3:25pm UTC](https://discourse.rom-rb.org/t/setting-an-association-by-passing-tuple-rather-than-id/528/1 "2022-04-14T15:25:36Z")

</div>

Greetings,  
Is it possible to create associations in this manner?

```auto
tasks_repo.create({ id: 1, user: {id: 1, name: "Jane"}, title: "Jane's task" })

```

Not an Aggregate Write as the user tuple has an id and there is no combine.  
OR do I have to use change sets:

```auto
task = tasks_repo.create(task_changeset.associate({id: 1, name: "Jane"}, :user))

```

Also I was wondering if an aggregate update can be done with change sets and if you can give reference to examples?

Many Thanks!

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.rom-rb.org/solnic/32/279_2.png) [@solnic](https://discourse.rom-rb.org/u/solnic)\
**Post date:** [April 19, 2022, 6:53am UTC](https://discourse.rom-rb.org/t/setting-an-association-by-passing-tuple-rather-than-id/528/2 "2022-04-19T06:53:20Z")

</div>

Repo command methods are very basic and don’t support combined commands, so you need to stick to changesets.
