# Loading partial models then filling them with Ember-data

**URL:** <https://discuss.emberjs.com/t/loading-partial-models-then-filling-them-with-ember-data/819>\
**Category:** Ember Data\
**Created:** [April 1, 2013, 8:07pm UTC](https://discuss.emberjs.com/t/loading-partial-models-then-filling-them-with-ember-data/819 "2013-04-01T20:07:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![roush\_chris](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/roush_chris/32/14699_2.png) [@roush\_chris](https://discuss.emberjs.com/u/roush_chris)\
**Post date:** [July 10, 2013, 4:09pm UTC](https://discuss.emberjs.com/t/loading-partial-models-then-filling-them-with-ember-data/819/3 "2013-07-10T16:09:23Z")

</div>

I’ve been trying to figure this out for a while and think I finally stumbled on something that works pretty well for me, YMMV.

I just overrode the `preprocessData` function on my `App.Store` to check if the data I’m supplying is a full item or partial, based on the attribute `basicInfo`, then checks to see if the item is already in the Store, and returns accordningly Here’s what my `App.Store` looks like now

```
App.Store = DS.Store.extend(
  revision: 12

  preprocessData: (type, data) ->

    if data.basic_info && this.hasReferenceForId(type, data.id)
      return unless this.find(type, data.id).get('basicInfo')

    @_super(type, data)

)

```

---

_[View the full topic](https://discuss.emberjs.com/t/loading-partial-models-then-filling-them-with-ember-data/819)._
