coldbox-modules / quick

A ColdBox ORM Engine
https://quick.ortusbooks.com
MIT License
23 stars 19 forks source link

`asQuery` called on a relationship returns the relationship rather than `quick.models.QuickBuilder` #227

Closed davidAtInleague closed 1 year ago

davidAtInleague commented 1 year ago

quick v6.2.1

x = getInstance("qUser").firstOrFail().someHasOneRelationship().asQuery()
y = getInstance("qUser").firstOrFail().someHasOneRelationship().retrieveQuery()

// quick.models.Relationships.HasOne
writedump(getmetadata(x).name)

// modules.quick.models.QuickQB
writedump(getmetadata(y).name)
elpete commented 1 year ago

So it’s not necessarily an error that it’s a different class. What are you trying to do from there that isn’t working?

davidAtInleague commented 1 year ago

This was sort of part of https://github.com/coldbox-modules/quick/issues/226, where it initially seemed like types not lining up was a cause, but this isn't a root cause of that issue. Not a bug it is.