ダッシュボード ビューのコントローラー メソッドで表示される情報の量が心配です。基本的に、このダッシュボード ビューにはアプリケーション内のユーザー情報とアクティビティが表示されますが、ビューに渡される情報の量が原因で、これはすぐに混乱してしまうと思います。
@answered = answered.length
@asked = asked.length
@pending = pending.length
@favorited = favorited.length
@medal_gold = thanks_received(:awesome).length
@medal_silver = thanks_received(:great).length
@medal_bronze = thanks_received(:good).length
@notification_pending = question_users_not_seen(pending, current_user.user_notification.pending_last_seen).count
@notification_silver = question_users_not_seen(thanks_received(:great), current_user.user_notification.silver_last_seen).count
@notification_gold = question_users_not_seen(thanks_received(:awesome), current_user.user_notification.gold_last_seen).count
@notification_bronze = question_users_not_seen(thanks_received(:good), current_user.user_notification.bronze_last_seen).count
@notification_asked = question_users_not_seen(asked, current_user.user_notification.asked_last_seen).any?
@notification_answered = question_users_not_seen(answered, current_user.user_notification.answered_last_seen).any?
@notification_favorited = question_users_not_seen(favorited, current_user.user_notification.favorited_last_seen).any?
このすべての情報をよりエレガントに記述する方法はありますか? 私はコードがどのように見えるかだけを気にしており、そのパフォーマンスについてはあまり気にしていません。