Document with_status name smell

This commit is contained in:
Jose Farias
2024-10-28 10:25:56 -06:00
parent dbad5a1a8c
commit 5cdf83163c
+1
View File
@@ -23,6 +23,7 @@ class Bubble < ApplicationRecord
left_joins_comments.select("bubbles.*, COUNT(comments.id) AS comment_count").group(:id).order("comment_count DESC")
end
# FIXME: `status` implies an enum. Consider a name change.
scope :with_status, ->(status) do
status = status.presence_in %w[ popped active unassigned ]
public_send(status) if status