Extract ActiveRecord Scope Method

Peer review today lead to a great refactoring opportunity. The pull request centered around allowing signed in site administrators to view unpublished blog posts. Original My goal here is to only have the published scope apply if the current_user is not an...

Optimize Rails Database Queries with Bullet and RSpec

Bullet is a gem that helps increase your application’s performance by reducing the number of queries it makes. The README describes how to use the gem in Development but makes no special mention of how to use it in test with RSpec. Searching through the gem...