Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Quick 10.0.1+] Property Case Lost When Using Aggregate withCount() #261

Open
homestar9 opened this issue Feb 8, 2025 · 0 comments
Open

Comments

@homestar9
Copy link
Contributor

This isn't really a bug per se, but if you call withCount(), the resulting property name won't preserve the case of the variable you passed into the method:

Example:

function scopeAddRemoteQuotesCount( qb ) {
        return qb.withCount( "remoteQuotes" );
}

The resulting property name will be remotequoteCount instead of remoteQuoteCount.

Why bring this up?
People using JavaScript to make ajax calls should be aware that the resulting variable won't match the case of the property of the entity.

Where does this issue occur?
In QueryBuilder.cfc, the withCount() method preserves the case all the way until this line:
var subselectName = getEntity().get_str().camel( relationName & " Count" );

Workarounds?
If you use the resulting property in JavaScript, just be aware that the case will be different than how it was defined in the entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant