RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: kainlite
Ryan, I've been watching a lot of railscasts, I'm lacking of knowledge in the subject, but there is a "Right way TM." to do a proper union in a "complex sql query" using ActiveRecord or Arel? I will show you what I'm trying to generate :(
SELECT * FROM users WHERE id = (SELECT enrollable_id FROM enrollments WHERE enrollable_type='User')
SELECT * FROM users WHERE id = (SELECT user_id FROM memberships WHERE group_id = (SELECT enrollable_id FROM enrollments WHERE enrollable_type='Group'))
Is awesome what you can get with Arel but I don't know if what I'm trying to do is breaking any rule or is just not possible using AR or Arel..
awesomeness on every railscast!
Great episode thank you Ryan, keep the good work ;-)
Awesome, you're great, I love your screencasts :)