Files
fizzy/app/models/tag.rb
T
2024-11-21 19:58:21 -06:00

19 lines
341 B
Ruby

class Tag < ApplicationRecord
include Filterable
belongs_to :account, default: -> { Current.account }
has_many :taggings, dependent: :destroy
has_many :bubbles, through: :taggings
scope :search, ->(query) { where "title LIKE ?", "%#{query}%" }
def hashtag
"#" + title
end
def to_combobox_display
title
end
end