Added the tagged_with scope here. Scopes are a very useful and flexible way to query the database.
A great thing about them is that they can be chained. If you were to add the scopes to the Post model, you could run a query looking something like this: Post.by_user(@user).from_year(2013).tagged_with('Ruby on Rails')
You probably don't need to know much about them yet, but eventually you'll get to know them very well.