diff --git a/app/helpers/bubbles_helper.rb b/app/helpers/bubbles_helper.rb index 12c833415..a88cadc30 100644 --- a/app/helpers/bubbles_helper.rb +++ b/app/helpers/bubbles_helper.rb @@ -8,9 +8,8 @@ module BubblesHelper end def bubble_size(bubble) - activity = bubble.boost_count + bubble.messages.comments.size rank = - case activity + case bubble.activity_count when 0..5 then "one" when 6..10 then "two" when 11..25 then "three" diff --git a/app/models/bubble.rb b/app/models/bubble.rb index 4c0cd24f7..15aef3a3c 100644 --- a/app/models/bubble.rb +++ b/app/models/bubble.rb @@ -48,6 +48,10 @@ class Bubble < ApplicationRecord end end + def activity_count + boost_count + messages.comments.size + end + private def set_default_title self.title = title.presence || "Untitled"