DEV Community

Discussion on: Preventing Useless Database Hits

Collapse
 
joshcheek profile image
Josh Cheek

Nice post 😊 I didn't know about none. I wonder why AR queries the db with 1=0 instead of doing whatever .none does πŸ€”

Collapse
 
molly profile image
Molly Struve (she/her)

Right? I went into the AR source code one weekend and tried to update it in such a way that none would be used when it saw an empty array. Broke a lot of specs and after 3 hours of trying to fix them I gave up. One day I will go back!

Collapse
 
joshcheek profile image
Josh Cheek

I feel that, lol. So vindicating when you finally get it after numerous independent attempts!