-
Ruby version
-
System dependencies
-
Configuration
-
Database creation
Column | Type | Options |
---|---|---|
nickname | string | null: false |
string | null: false | |
first_name | string | null: false |
last_name | string | null: false |
first_name_kana | string | null: false |
last_name_kana | string | null: false |
birthday | date | null: false |
phone | string | null: false |
wallet | integer | null: false |
- has_many :bought_items,, foreign_key: "buyer_id", class_name: "Item"
- has_many :selling_items, -> { where("buyer_id is NULL") }, foreign_key: "seller_id", class_name: "Item"
- has_many :sold_items, -> { where("buyer_id is not NULL") }, foreign_key: "seller_id", class_name: "Item"
- has_one :credit_card, index: { unique: true } ,foreign_key: "credit_card_id", dependent: :destroy
- has_one :address, foreign_key: "address_id", dependent: :destroy
- has_many :grades, foreign_key: "grades_id", dependent: :destroy
- has_many :comments
- has_many :favorites, dependent: :destroy
- has_many :favorite_items, through: :favorites, source: :item
- has_many :user_notifications
- has_many :notifications, through :user_notifications
- has_many :buy_dealing_items, foreign_key: "buyer_id", class_name: "Item"
- has_many :sell_dealing_items, foreign_key: "seller_id", class_name: "Item"
- userが削除されてもcomments自体は残して「このユーザーは退会しました」のメッセージを入れる。
Column | Type | Options |
---|---|---|
postal_code | string | null: false |
prefecture | string | null: false |
municipalities | string | null: false |
address | string | null: false |
building | string | - |
user_id | integer | null: false, foreign_key: true |
- belongs_to :user, foreign_key: "user_id"
Column | Type | Options |
---|---|---|
number | integer | null: false |
valid_year | integer | null: false |
valid_month | integer | null: false |
security_code | integer | null: false |
user_id | integer | null: false, foreign_key: true |
- belongs_to :user, foreign_key: "user_id"
Column | Type | Options |
---|---|---|
rank | integer | limit: 2 |
seller_id | integer | null: false, foreign_key: true |
buyer_id | integer | null: false, foreign_key: true |
- belongs_to :seller, class_name: "User"
- belongs_to :buyer, class_name: "User"
Column | Type | Options |
---|---|---|
name | string | null: false |
description | text | null: false |
category_id | integer | null: false, foreign_key: true |
size | string | - |
brand_id | integer | foreign_key: true |
condition | string | null: false |
shipping_fee | string | null: false |
shipping_method | string | null: false |
prefecture | string | null: false |
shipping_date | string | null: false |
price | integer | null: false |
profit | integer | null: false |
status | integer | default: 0, null: false, limit: 2 |
seller_id | integer | null: false, foreign_key: true |
buyer_id | integer | foreign_key: true |
- belongs_to :seller, class_name: "User"
- belongs_to :buyer, class_name: "User"
- has_many :images, dependent: :destroy
- belongs_to_active_hash :category
- belongs_to_active_hash :brand
- has_many :comments, dependent: :destroy
- has_many :favorites, dependent: :destroy
- has_many :users, through: :favorites, dependent: :destroy
- validates :name, length: { in: 1..40 }
- statusはenumを使用。0: selling , 1:dealing, 2: sold_out
- prefectureはアソシエーションの必要ないかな。出品ページにprefectureDBから表示する
Column | Type | Options |
---|---|---|
image | string | null: false |
item_id | integer | null: false, foreign_key: true |
- belongs_to :item
Column | Type | Options |
---|---|---|
content | text | null: false |
user_id | integer | foreign_key: true |
item_id | integer | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :item
Column | Type | Options |
---|---|---|
user_id | integer | null: false, foreign_key: true |
item_id | integer | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :item
Column | Type | Options |
---|---|---|
name | string | null: false |
ancestry | string | null: false |
- has_ancestry
- has_many :items
- has_many :category_brands
- has_many_active_hash :brands, through :category_brands
- gem 'ancestry'を使用
Column | Type | Options |
---|---|---|
name | string | null: false |
- has_many :items
- has_many :category_brands
- has_many_active_hash :categories, through :category_brands
Column | Type | Options |
---|---|---|
brand_id | integer | null: false |
category_id | integer | null: false |
- belongs_to_active_hash :category
- belongs_to_active_hash :brand
Column | Type | Options |
---|---|---|
content | string | null: false |
user_id | string | null: false |
- belongs_to :user
Column | Type | Options |
---|---|---|
title | string | null: false |
content | string | null: false |
Column | Type | Options |
---|---|---|
content | string | null: false |
- has_many :user_notifications
- has_many :users, through :user_notifications
Column | Type | Options |
---|---|---|
notification_id | string | null: false |
user_id | string | null: false |
- belongs_to :user
- belongs_to :notification
Column | Type | Options |
---|---|---|
name | string | null: false |
- active hash 使用
-
Database initialization
-
How to run the test suite
-
Services (job queues, cache servers, search engines, etc.)
-
Deployment instructions
-
...