Not sure what you mean about the single line conditionals.  

I did try creating an SQL based scope.  It was complicated, so I tried to see how good of performance I could get out of Ruby.