Files
fizzy/app/models/tag.rb
T
Mike Dalessio 506f74144b Touch Account when adding or removing a Tag
so we can properly cache the tags partial using account as part of the key.
2025-03-24 16:48:11 -04:00

15 lines
292 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#/ }
def hashtag
"#" + title
end
end