Skip to content

Commit ba8a3b6

Browse files
committed
init book model
1 parent a285f63 commit ba8a3b6

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

app/models/book.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Book < ApplicationRecord
2+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class CreateBooks < ActiveRecord::Migration[6.1]
2+
def change
3+
create_table :books do |t|
4+
t.string :title
5+
6+
t.timestamps
7+
end
8+
end
9+
end

db/schema.rb

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/fixtures/books.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2+
3+
one:
4+
title: MyString
5+
6+
two:
7+
title: MyString

test/models/book_test.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require "test_helper"
2+
3+
class BookTest < ActiveSupport::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

0 commit comments

Comments
 (0)