adonisjs / lucid

AdonisJS SQL ORM. Supports PostgreSQL, MySQL, MSSQL, Redshift, SQLite and many more
https://lucid.adonisjs.com/
MIT License
1.08k stars 195 forks source link

Clone the preloader when cloning the query builder #1050

Closed RomainLanz closed 2 months ago

RomainLanz commented 2 months ago

Hey there! 👋🏻

Follow up on this failing test: https://github.com/adonisjs/lucid/pull/1041

This PR adds a method to the Preloader class to allow cloning. We use this method when cloning the query to also clone the preloader.

Closes https://github.com/adonisjs/lucid/pull/1041 Closes https://github.com/adonisjs/lucid/issues/1033

thetutlage commented 2 months ago

Looks great