mikepmunroe/games_filter — pull request #11 by davekaro (2013-03-21 14:36:25+00:00)
Title: This is fun!

New features to review with new pull requests every day?!

Anyways, the key here is I wanted to use ActiveRecord::Relation to keep the duplication down. When you do something like `Athlete.where(:affiliate => 'southie')` - Rails will just create an ActiveRecord::Relation object, and not actually hit the database. Then, you can use this object to chain on more conditions, all with never hitting the database. The database will finally be queried once you start to iterate over the results, which usually isn't until the view.