diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-02-16 08:53:17 +0000 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-05-21 03:16:21 -0500 |
commit | 10b20607aced6ffe541b2d33af2b450fe6803992 (patch) | |
tree | 09e379c47eecd5fccb5ac528d64a18fabf4af0db /app | |
parent | 1d5da3990200f8e1b4db64eab5dff7691dc93353 (diff) |
allow hypens in hashtags
Diffstat (limited to 'app')
-rw-r--r-- | app/models/tag.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tag.rb b/app/models/tag.rb index 7db76d157..ecfe4f7e8 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -17,7 +17,7 @@ class Tag < ApplicationRecord has_many :featured_tags, dependent: :destroy, inverse_of: :tag has_one :account_tag_stat, dependent: :destroy - HASHTAG_NAME_RE = '[[:word:]_]*[[:alpha:]_·][[:word:]_]*' + HASHTAG_NAME_RE = '[[:word:]_\-]*[[:alpha:]_·\-][[:word:]_\-]*' HASHTAG_RE = /(?:^|[^\/\)\w])#(#{HASHTAG_NAME_RE})/i validates :name, presence: true, uniqueness: true, format: { with: /\A#{HASHTAG_NAME_RE}\z/i } |