# How can I load seed data for my app?

**URL:** <https://discuss.emberjs.com/t/how-can-i-load-seed-data-for-my-app/9840>\
**Category:** Ember Data\
**Created:** [February 18, 2016, 9:33pm UTC](https://discuss.emberjs.com/t/how-can-i-load-seed-data-for-my-app/9840 "2016-02-18T21:33:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew1](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/andrew1/32/10636_2.png) [@andrew1](https://discuss.emberjs.com/u/andrew1)\
**Post date:** [February 18, 2016, 9:34pm UTC](https://discuss.emberjs.com/t/how-can-i-load-seed-data-for-my-app/9840/1 "2016-02-18T21:34:00Z")

</div>

Hi everyone,

We have some constant data that we need to load from the server once when our Ember app boots. This is basic stuff like the copy for our error messages, etc… The reason we don’t hard code this in the Ember app is that we want our marketing team to own the copy in their CRM.

What’s the best way to load this data in? Basically, I want to do a `this.store.findAll('constants')` to initialize the constants service that will be used in the rest of the app.

Any help would be greatly appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![broerse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/broerse/32/9497_2.png) [@broerse](https://discuss.emberjs.com/u/broerse)\
**Post date:** [February 18, 2016, 10:13pm UTC](https://discuss.emberjs.com/t/how-can-i-load-seed-data-for-my-app/9840/2 "2016-02-18T22:13:13Z")

</div>

We still use the fixture adapter for this. Our Ember 2.0 fork is here:

[https://github.com/martinic/ember-data-fixture-adapter](https://github.com/martinic/ember-data-fixture-adapter)

If you need a adapter example I have to lookup the code on an other system.

---

<div class="post-metadata">

**Author:** ![andrew1](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/andrew1/32/10636_2.png) [@andrew1](https://discuss.emberjs.com/u/andrew1)\
**Post date:** [February 18, 2016, 11:31pm UTC](https://discuss.emberjs.com/t/how-can-i-load-seed-data-for-my-app/9840/3 "2016-02-18T23:31:24Z")

</div>

How do you load the data from the back-end? We might be talking about 2 different issues. I’m fine using the JSONAPIAdapter, I just want to `findAll` once and then `peekAll` (for example) in the rest of my routes.

---

<div class="post-metadata">

**Author:** ![francesconovy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/francesconovy/32/9607_2.png) [@francesconovy](https://discuss.emberjs.com/u/francesconovy)\
**Post date:** [February 19, 2016, 1:09am UTC](https://discuss.emberjs.com/t/how-can-i-load-seed-data-for-my-app/9840/4 "2016-02-19T01:09:06Z")

</div>

You can just do this in your application route’s `beforeModel` hook. E.g.

```auto
beforeModel: function() {
  return Ember.RSVP.all([
    this.get('store').findAll('static-model-type-1'),
    this.get('store').findAll('static-model-type-2'),
  ]);
}

```

And then, as you mentioned, just use `this.get('store').peekRecord()` from then on.

---

<div class="post-metadata">

**Author:** ![andrew1](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/andrew1/32/10636_2.png) [@andrew1](https://discuss.emberjs.com/u/andrew1)\
**Post date:** [February 19, 2016, 5:25am UTC](https://discuss.emberjs.com/t/how-can-i-load-seed-data-for-my-app/9840/5 "2016-02-19T05:25:25Z")

</div>

Thanks. I’ll give that a try. We’d experimented with it before and it didn’t seem like the hooks in `ApplicationRoute` were blocking for the promise it returns to resolve.

I’ll try again to make sure there’s nothing that I’m missing.

---

<div class="post-metadata">

**Author:** ![broerse](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/broerse/32/9497_2.png) [@broerse](https://discuss.emberjs.com/u/broerse)\
**Post date:** [February 19, 2016, 2:52pm UTC](https://discuss.emberjs.com/t/how-can-i-load-seed-data-for-my-app/9840/6 "2016-02-19T14:52:49Z")

</div>

Oh I misunderstood your question. Glad @francesconovy didn’t 😉
