Files
fizzy/app/models/tag.rb
T
David Heinemeier Hansson ee22e69e6e Move taggings to bubbles
2025-04-05 22:19:12 +02:00

17 lines
347 B
Ruby

class Tag < ApplicationRecord
include Filterable
belongs_to :account, default: -> { Current.account }, touch: true
has_many :taggings, dependent: :destroy
has_many :bubbles, through: :taggings
validates :title, format: { without: /\A#/ }
scope :alphabetically, -> { order("lower(title)") }
def hashtag
"#" + title
end
end