506f74144b
so we can properly cache the tags partial using account as part of the key.
15 lines
292 B
Ruby
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
|