emberjs/data — pull request #827 by mmpestorich (2013-03-21 15:16:56+00:00)
Title: Setup data without triggering materialization.

A model's data is lazily initialized but in doing so currently triggers the materialization process. This is a problem if something tries to access the model's data while it is in a loading state - for example, binding to a property on an record that is not yet loaded currently has this affect:

```javascript
var record = SomeModel.find(1);
```
Will put the record into a loading state:
```javascript
record.stateManager.currentState.path === 'rootState.loading' //true
```
In the meantime, before data has been returned from the server:
```javascript
var MyObject = Ember.Object.extend({
init: function() {
set(this, 'valueBinding', Ember.bind(this, 'value', 'record.' + get(this, 'property')));
}
});
MyObject.create({ record: record, property: 'name'})
```
The binding will eventually attempt to get the model's data, the model's data is lazily initialized (eventually in the store's materializeData) and a materializingData event is sent to the model causing the model's state to transition:
```javascript
record.stateManager.currentState.path === 'rootState.loaded.materializing.firstTime' //true
```
...and then a finishedMaterializing event is sent causing a transition to:
```javascript
record.stateManager.currentState.path === 'rootState.loaded.saved' //true
```
The problem is that the model's data hasn't actually come back from the server yet and as such should not be in a loaded state in which isLoaded equals true and didLoad has been triggered resolving the load promise.

I believe that materialization should only be triggered by transitioning out of the loading state and not by simply accessing a model's data. This commit allows data to be lazily init'd without triggering materialization.