Hacker News new | ask | show | jobs
by vinceguidry 2583 days ago
> arbitrary SQL cannot be combined or reused in a way which leads to compositional queries

You can do this, look into arel. Here's a blog post:

https://blog.codeship.com/creating-advanced-active-record-db...

1 comments

Yes, I know about Arel, and I’ve used it a few times to do hairy queries, but honestly it felt like swimming against the current and I wouldn’t recommend anyone write Arel queries by hand.