purekid/mongodm — pull request #79 by wildsurfer (2014-11-26 14:02:23+00:00)
Title: Fix "fieldname is not instance of 'Models\XXXXX'" error

When your model have references

``` php
protected static $attrs = array(
'number' => array('type' => 'integer'),
'fieldname' => array('model'=>'Models\Somemodel','type'=>'reference')
);
```

You may face some exceptions when you try to do smth like this:

```php
$obj = new Somemodel::id(...);
$data = $obj->toArray();
$data['number']++;
$obj->update($data);
```

This PR should fix it