mirror of https://github.com/mastodon/mastodon
parent
072158ee97
commit
e64e6a03dd
@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: custom_emoji_categories
|
||||
#
|
||||
# id :bigint(8) not null, primary key
|
||||
# name :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
|
||||
class CustomEmojiCategory < ApplicationRecord
|
||||
has_many :emojis, class_name: 'CustomEmoji', foreign_key: 'category_id', inverse_of: :category
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
class CreateCustomEmojiCategories < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :custom_emoji_categories do |t|
|
||||
t.string :name, index: { unique: true }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddCategoryIdToCustomEmojis < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :custom_emojis, :category_id, :bigint
|
||||
end
|
||||
end
|
@ -0,0 +1,3 @@
|
||||
Fabricator(:custom_emoji_category) do
|
||||
name "MyString"
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe CustomEmojiCategory, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in New Issue