column | type | options |
---|---|---|
nickname | string | null: false |
string | null: false | |
encrypted_password | string | null: false |
last_name | string | null: false |
first_name | string | null: false |
last_name_katakana | string | null: false |
first_name_katakana | string | null: false |
birthday | date | null: false |
has_many :items, dependent: :destroy has_many :purchases, dependent: :destroy
column | type | options |
---|---|---|
item_name | string | null: false |
explanation | text | null: false |
category_id | integer | null: false |
condition_id | integer | null: false |
shipping_cost_id | integer | null: false |
prefecture_id | integer | null: false |
days_to_ship_id | integer | null: false |
price | integer | null: false |
user | references | null: false, foreign_key; true |
belongs_to :user has_one :purchase
column | type | options |
---|---|---|
user | references | null: false, foreign_key: true |
item | references | null: false, foreign_key: true, unique: true |
belongs_to :user belongs_to :item has_one :shipping_address
column | type | options |
---|---|---|
postal_code | string | null: false |
prefecture_id | integer | null: false |
city | string | null: false |
address | string | null: false |
building_name | string | |
phone_number | string | null: false |
purchase | references | null: false, foreign_key; true |
belongs_to :purchase