From d176815bf0ffc0a425a2c81513117144761c767c Mon Sep 17 00:00:00 2001 From: hoangtuyb96 Date: Thu, 9 Jan 2025 00:02:59 +0700 Subject: [PATCH] Add user model --- app/models/user.rb | 2 ++ db/migrate/20250108170244_create_users.rb | 8 ++++++++ test/fixtures/users.yml | 11 +++++++++++ test/models/user_test.rb | 7 +++++++ 4 files changed, 28 insertions(+) create mode 100644 app/models/user.rb create mode 100644 db/migrate/20250108170244_create_users.rb create mode 100644 test/fixtures/users.yml create mode 100644 test/models/user_test.rb diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..379658a --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,2 @@ +class User < ApplicationRecord +end diff --git a/db/migrate/20250108170244_create_users.rb b/db/migrate/20250108170244_create_users.rb new file mode 100644 index 0000000..1ec6d0d --- /dev/null +++ b/db/migrate/20250108170244_create_users.rb @@ -0,0 +1,8 @@ +class CreateUsers < ActiveRecord::Migration[7.1] + def change + create_table :users do |t| + + t.timestamps + end + end +end diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000..d7a3329 --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the "{}" from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000..5c07f49 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end