Did you mean to extend ActiveRecord::ReadOnly which you defined below?

Also, what would you think about moving this out into app/models/shared_earned_badge.rb? I think that makes more sense since it's a view encompassing more than just the users table.