turingschool-examples / intermission-assignments

33 stars 218 forks source link

Sean Griffin's Using arel #14

Closed EmilyMB closed 9 years ago

EmilyMB commented 9 years ago

Discuss Using Arel to Compose SQL Queries here.

nathanows commented 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.

EmilyMB commented 9 years ago

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.

KristaANelson commented 9 years ago

Love this! Had no idea Arel even existed. I want to go refactor my dog tinder to use this. Love the readability part.

Lydias303 commented 9 years ago

I want to try this out. I have struggled with queries and this might be nifty to play around with.

bmrsny commented 9 years ago

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!

mikedao commented 9 years ago

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.