jarektkaczyk / eloquence-base

base for the Eloquence extensions + Searchable
https://softonsofa.com
MIT License
77 stars 69 forks source link

Add a unit test for testing nested relationships with soft deleted records. #2

Closed maqduni closed 6 years ago

maqduni commented 6 years ago

Added the requested unit test as was requested in https://github.com/jarektkaczyk/eloquence/issues/220. If you don't like the idea of filtering out deleted records inside of a join then a way to exclude softly deleted records would be adding 'where "posts"."deleted_at" is null '; at the end of the statement.

I also thought it might make sense to have a sort of withTrashed scope that would enable search across deleted records. Let me know your thoughts about it, I'll also be thinking about a better way to do it if it at least makes sense...