parent
8ae3306bd3
commit
082e57fc13
@ -0,0 +1,5 @@
|
||||
class Tag < ApplicationRecord
|
||||
HASHTAG_RE = /[?:^|\s|\.|>]#([[:word:]_]+)/i
|
||||
|
||||
validates :name, presence: true, uniqueness: true
|
||||
end
|
@ -0,0 +1,11 @@
|
||||
class CreateTags < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :tags do |t|
|
||||
t.string :name, null: false, default: ''
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :tags, :name, unique: true
|
||||
end
|
||||
end
|
@ -0,0 +1,3 @@
|
||||
Fabricator(:tag) do
|
||||
name "MyString"
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Tag, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in new issue