We're updating the issue view to help you get more done. 

Where A (AND scope B OR scope C) support

Description

Given two scopes from the docs:

1 2 3 4 5 6 7 function scopeSubscribed( query ) { return query.where( "subscribed", true ); } function scopeOfType( query, type ) { return query.where( "type", type ); }

Suppose you want to use some more complex paren grouping with OR statements, similar to the example in the QB docs for WHERE (a = ? OR b = ?) AND c = ?, you should be able to do something like this rather contrived example:

1 2 3 4 5 6 7 8 9 function scopeMighty (query ) { return query.whereFoo( "bar" ) .where( function ( sQ ) { sQ.scopeOfType( "someType" ) .orWhere( function( sQ2 ) { sQ2.scopeSubscribed() } ); } ); }

But you can't use scopes, either explicitly (.scopeSubscribed() ) or implicitly ( .subscribed() ) on the closure object because the function isn't defined.

This feels related to - it's really a QB feature that you get used to having that'd be great to carry over to Quick.

Status

Assignee

Unassigned

Reporter

Samuel W. Knowlton

Labels

None

Priority

Major