Adding hashtags
This commit is contained in:
parent
62292797ec
commit
48b9619439
33 changed files with 305 additions and 62 deletions
|
@ -1,5 +1,11 @@
|
|||
class Tag < ApplicationRecord
|
||||
has_and_belongs_to_many :statuses
|
||||
|
||||
HASHTAG_RE = /[?:^|\s|\.|>]#([[:word:]_]+)/i
|
||||
|
||||
validates :name, presence: true, uniqueness: true
|
||||
|
||||
def to_param
|
||||
name
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue