Adding hashtag model

This commit is contained in:
Eugen Rochko
2016-11-04 19:12:59 +01:00
parent 6471a548fe
commit 62292797ec
11 changed files with 60 additions and 9 deletions

5
app/models/tag.rb Normal file
View File

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