Files
fizzy/app/models/tag.rb
T
Mike Dalessio 151787a864 Remove dead Tag::Attachable code and tags prompt
The tags prompt was added for the Fizzy Do command system, but became
dead code when commands were removed in 89af9066. The commands_prompt
was cleaned up but tags_prompt was missed.

Remove the Tag::Attachable concern, Prompts::TagsController, its views
and route, and the tags_prompt helper. Tag still includes
ActionText::Attachable directly, which is needed by the data transfer
system.
2026-04-09 17:13:41 -04:00

22 lines
528 B
Ruby

class Tag < ApplicationRecord
include ActionText::Attachable, Filterable
belongs_to :account, default: -> { Current.account }
has_many :taggings, dependent: :destroy
has_many :cards, through: :taggings
validates :title, format: { without: /\A#/ }
normalizes :title, with: -> { it.downcase }
scope :alphabetically, -> { order("lower(title)") }
scope :unused, -> { left_outer_joins(:taggings).where(taggings: { id: nil }) }
def hashtag
"#" + title
end
def cards_count
cards.open.count
end
end