Add GameSystem model
This commit is contained in:
parent
f70a676456
commit
ed01262d88
|
@ -0,0 +1,3 @@
|
||||||
|
class GameSystem < ApplicationRecord
|
||||||
|
validates :name, presence: true
|
||||||
|
end
|
|
@ -0,0 +1,9 @@
|
||||||
|
class CreateGameSystems < ActiveRecord::Migration[7.1]
|
||||||
|
def change
|
||||||
|
create_table :game_systems do |t|
|
||||||
|
t.string :name, null: false
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -10,10 +10,16 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.1].define(version: 2024_04_14_122652) do
|
ActiveRecord::Schema[7.1].define(version: 2024_05_26_084840) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
|
create_table "game_systems", force: :cascade do |t|
|
||||||
|
t.string "name", null: false
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "users", force: :cascade do |t|
|
create_table "users", force: :cascade do |t|
|
||||||
t.string "username", limit: 20, null: false
|
t.string "username", limit: 20, null: false
|
||||||
t.string "password_digest", limit: 200, null: false
|
t.string "password_digest", limit: 200, null: false
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
troika:
|
||||||
|
name: Troika
|
|
@ -0,0 +1,7 @@
|
||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class GameSystemTest < ActiveSupport::TestCase
|
||||||
|
test "name must exist" do
|
||||||
|
assert_must_exist(game_systems(:troika), :name)
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue