# PSA: Working With Model Relationships

**URL:** <https://discuss.emberjs.com/t/psa-working-with-model-relationships/9021>\
**Category:** Ember Data\
**Created:** [October 28, 2015, 7:32am UTC](https://discuss.emberjs.com/t/psa-working-with-model-relationships/9021 "2015-10-28T07:32:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![uberclops](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/uberclops/32/10217_2.png) [@uberclops](https://discuss.emberjs.com/u/uberclops)\
**Post date:** [October 28, 2015, 7:32am UTC](https://discuss.emberjs.com/t/psa-working-with-model-relationships/9021/1 "2015-10-28T07:32:21Z")

</div>

When working with model relationships remember that they may be lazy, and even though getting and setting properties on a proxy object work as if you’re using the entity directly, things like comparison between entities (e.g. when using addons such as ember-truth-helpers) may not behave as you would expect.

Always resolve the promise obtained from accessing a relationship before doing any sort of comparison between entities e.g. `this.get('model.relationship').then(relationship => {})`.

When passing values into a component, you can ensure you’re working with the underlying object by using the `didReceiveAttrs` hook and wrapping `getAttr` in a promise e.g. `Promise(this.getAttr('attribute')).then(attribute => this.set('attr1', attribute))`.
