logo Boston Ruby Group


July 8, 2014

Don't Be So Concerned

by Melanie Gilman

Developers are concerned about concerns. When used correctly and in moderation, ActiveSupport::Concern is a useful tool. It improves code clarity, keeps it DRY, and encapsulates shared logic. In this talk, I'll explain what happens when ActiveSupport::Concern is included in Rails models and controllers, and how it differs from a plain old module. We'll walk through some example code, discuss best practices, and test them with RSpec. It's not all roses though. To close, we'll examine the drawbacks and explore alternatives.