From 81197bfb495c8215e732fbba4d985871dba81dab Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Fri, 7 Feb 2025 17:54:49 +0000 Subject: [PATCH] Don't set a default title --- app/helpers/bubbles_helper.rb | 4 ++++ app/models/bubble.rb | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/helpers/bubbles_helper.rb b/app/helpers/bubbles_helper.rb index bfb37b245..0eaa94bf9 100644 --- a/app/helpers/bubbles_helper.rb +++ b/app/helpers/bubbles_helper.rb @@ -1,6 +1,10 @@ module BubblesHelper BUBBLE_ROTATION = %w[ 75 60 45 35 25 5 ] + def bubble_title(bubble) + bubble.title.presence || "Untitled" + end + def bubble_rotation(bubble) value = BUBBLE_ROTATION[Zlib.crc32(bubble.to_param) % BUBBLE_ROTATION.size] diff --git a/app/models/bubble.rb b/app/models/bubble.rb index ccd1021f6..856f6eb33 100644 --- a/app/models/bubble.rb +++ b/app/models/bubble.rb @@ -9,7 +9,6 @@ class Bubble < ApplicationRecord has_one_attached :image, dependent: :purge_later - before_save :set_default_title after_save :track_due_date_change, if: :saved_change_to_due_on? after_save :track_title_change, if: :saved_change_to_title? @@ -54,8 +53,4 @@ class Bubble < ApplicationRecord }) end end - - def set_default_title - self.title = title.presence || "Untitled" - end end