Open homestar9 opened 2 years ago
This issue has been mentioned on Ortus Solutions Community. There might be relevant details there:
One way to enable this behavior would be to make the following code changes:
BaseEntity.cfc
guardAgainstNotLoaded()
in relationship calls like in belongsTo()
isNullValue()
if ( !arguments.keyExists( "value" ) ) {
return true;
}
I'm coming from a place of not being very familiar with Quick, but based on some "hack and slash" experiments, this change appears to work.
@elpete Submitted a pull request for your review. https://github.com/coldbox-modules/quick/pull/178
Please be gentle, this is my first Quick PR. ;)
Related to this post on the Ortus community forums.
It would be great if, when requesting relationship data from a non-loaded (new) entity, Quick would return null (or an empty array where appropriate) just like if you performed the same operation from a loaded entity. This behavior should be more intuitive and also better follows the null object pattern.
Here's a simple example of how one might use this new change in Quick: