Closed EmilyMB closed 9 years ago
The refactored Arel table at the end is really interesting. I haven't / wouldn't have used private methods inside of a query before. It looks really clean, and I like that, but the syntax is still a little confusing and would probably require a bit more research to actually use. Specifically, the this.or(that)
is really interesting.
I haven't needed any crazy queries in Rails apps yet, but I can see why following Sean's method for breaking things down would be helpful for complicated queries. I agree with Nathan that the syntax is unfamiliar.
Love this! Had no idea Arel even existed. I want to go refactor my dog tinder to use this. Love the readability part.
I want to try this out. I have struggled with queries and this might be nifty to play around with.
I had no idea this existed. The syntax is really unfamiliar. Until I actually try my hand at this, I can't give a good opinion. Will need to read this post at least one more time!
This was fairly interesting to me. I've avoided complicated requests a lot by designing things in a manner that I won't need them, but I know this won't be available to me in the future.
Discuss Using Arel to Compose SQL Queries here.