Pull out Bubble#activity_count
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user