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