documentation/app/models/tag.rb

6 lines
134 B
Ruby

class Tag < ApplicationRecord
HASHTAG_RE = /[?:^|\s|\.|>]#([[:word:]_]+)/i
validates :name, presence: true, uniqueness: true
end