Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit e106ec8

Browse files
committed
started with user
1 parent f7d0968 commit e106ec8

4 files changed

Lines changed: 45 additions & 0 deletions

File tree

app/models/user.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class User < ApplicationRecord
2+
def change
3+
create_tables :users do |t|
4+
t.string :email, null: false, limit: 191
5+
t.string :name, null: false
6+
t.bigint :storage_quota, default: 5_368_709_120
7+
t.bigint :storage_used, default: 0
8+
9+
t.timestamps
10+
t.index :email, unique: true
11+
end
12+
end
13+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class CreateUsers < ActiveRecord::Migration[7.1]
2+
def change
3+
create_table :users do |t|
4+
t.string :email
5+
t.string :name
6+
t.bigint :storage_quota
7+
t.bigint :storage_used
8+
9+
t.timestamps
10+
end
11+
end
12+
end

test/fixtures/users.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2+
3+
one:
4+
email: MyString
5+
name: MyString
6+
storage_quota:
7+
storage_used:
8+
9+
two:
10+
email: MyString
11+
name: MyString
12+
storage_quota:
13+
storage_used:

test/models/user_test.rb

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

0 commit comments

Comments
 (0)