@@ -40,7 +40,7 @@ class Repository {
4040 }
4141
4242 if ( findQuery instanceof QueryBuilder ) {
43- findQuery = findQuery . toImplementation ( ) ;
43+ findQuery = findQuery . toImplementation ( this . model ) ;
4444 }
4545
4646 return this . model . count ( findQuery ) ;
@@ -53,7 +53,7 @@ class Repository {
5353 * @returns {Promise<array> } Promise object representing the full mock data
5454 */
5555 async findAll ( findQuery = { } ) {
56- return this . model . findAll ( findQuery instanceof QueryBuilder ? findQuery . toImplementation ( ) : findQuery ) ;
56+ return this . model . findAll ( findQuery instanceof QueryBuilder ? findQuery . toImplementation ( this . model ) : findQuery ) ;
5757 }
5858
5959 /**
@@ -69,7 +69,7 @@ class Repository {
6969
7070 if ( findQuery instanceof QueryBuilder ) {
7171 findQuery . set ( 'distinct' , true ) ;
72- findQuery = findQuery . toImplementation ( ) ;
72+ findQuery = findQuery . toImplementation ( this . model ) ;
7373 }
7474
7575 return this . model . findAndCountAll ( findQuery ) ;
@@ -83,7 +83,7 @@ class Repository {
8383 */
8484 async findOne ( findQuery = { } ) {
8585 if ( findQuery instanceof QueryBuilder ) {
86- findQuery = findQuery . toImplementation ( ) ;
86+ findQuery = findQuery . toImplementation ( this . model ) ;
8787 }
8888 findQuery . limit = 1 ;
8989 return this . model . findOne ( findQuery ) ;
@@ -133,7 +133,7 @@ class Repository {
133133 */
134134 async removeAll ( findQuery ) {
135135 if ( findQuery instanceof QueryBuilder ) {
136- findQuery = findQuery . toImplementation ( ) ;
136+ findQuery = findQuery . toImplementation ( this . model ) ;
137137 }
138138
139139 const entities = await this . findAll ( findQuery ) ;
@@ -152,7 +152,7 @@ class Repository {
152152 */
153153 async removeOne ( findQuery ) {
154154 if ( findQuery instanceof QueryBuilder ) {
155- findQuery = findQuery . toImplementation ( ) ;
155+ findQuery = findQuery . toImplementation ( this . model ) ;
156156 }
157157 findQuery . limit = 1 ;
158158
@@ -184,7 +184,7 @@ class Repository {
184184 */
185185 async updateAll ( patch , findQuery ) {
186186 if ( findQuery instanceof QueryBuilder ) {
187- findQuery = findQuery . toImplementation ( ) ;
187+ findQuery = findQuery . toImplementation ( this . model ) ;
188188 }
189189
190190 return this . model . update ( patch , findQuery ) ;
0 commit comments