Hi Jens,
> thanks for the response. I found out that for me it only works if I leave
> out the "coerce:false" on both sides of the relation (I guess it defaults
> to true then).
Yes, in that case Guacamole will try to coerce the assignment into the correct
type. And currently this results under certain circumstances in an endless loop.
> With "coerce:false" I do not get an Array after loading the model from the
> database but an AQL query that does not respond to the Array methods like
> "<<".
> This basically leaves me with a relation that I cannot update or which I
> could only update by bypassing guacamole(?), which is not really desirable.
You could use this as a work around:
```
user.environments = (user.environments << new_env)
```
I'm well aware that this is not desired and needs another solution. But it doesn't
bypass Guacamole and you could at least work for now. Sorry for the inconvience :/
> I haven't dug through the code in enough detail, but I guess that
> coerce:false also serves as some kind of lazy loading function, right?
> (which would be nice for larger graphs)
The ideal solution would be the user doesn't need to add `coerce: false` to any attribute.
Only if she really wants this. For relations this should just work. Currently there
is lazy loading mechanism in place (technically even with `coerce: true`). One problem is
the query should just forward array methods correctly to the underlying result set. This
is currently not the case.
I hope I could help you out in someway. Overall Guacamole is still a little rough around the edges
and we need reports of uses in the wild. Thanks for that.
Kind regards,
Dirk
> <
http://about.me/jens.hausherr>