Skip to content

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

@homestar9

Description

@homestar9

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions