# テーブル設計
Column | Type | Options |
---|---|---|
string | null: false, unique: true | |
encrypted_password | string | null: false |
nickname | string | null: false |
first_name | string | null: false |
last_name | string | null: false |
read_first | string | null: false |
read_last | string | null: false |
birthday | date | null: false |
- has_many :items
- has_many :orders
Column | Type | Options |
---|---|---|
name | string | null: false |
explanation | text | null: false |
category_id | integer | null: false |
condition_id | integer | null: false |
delivery_charge_id | integer | null: false |
prefecture_id | integer | null: false |
arrival_day_id | integer | null: false |
price | integer | null: false |
user | references | null: false, foreign_key: true |
- belongs_to :user
- has_one :order
- belongs_to_active_hash :category
- belongs_to_active_hash :condition
- belongs_to_active_hash :delivery_charge
- belongs_to_active_hash :prefecture
- belongs_to_active_hash :arrival_day
Column | Type | Options |
---|---|---|
user | references | null: false, foreign_key: true |
item | references | null: false, foreign_key: true |
- has_one :payment
- belongs_to :user
- belongs_to :item
Column | Type | Options |
---|---|---|
zip_code | string | null: false |
prefecture_id | integer | null: false |
city | string | null: false |
street_number | string | null: false |
building_name | string | |
phone_number | string | null: false |
order | references | null: false, foreign_key: true |
- belongs_to :order