Userモデルのbirthdayカラムに'2010-01-08'というふうに年代が入っている場合
User.select("count(user.id) as count, truncate( timestampdiff(year,birthday,curdate())/10,0) as age").group(:age)
とすると、10代、20代...のように年代ごとに集計できます。
timestampdiffについてはこちら
https://dev.mysql.com/doc/refman/5.6/ja/date-calculations.html