Column | Type | Options |
---|---|---|
nickname | string | null: false |
first_name | string | null: false |
first_name_furigana | string | null: false |
last_name | string | null: false |
last_name_furigana | string | null: false |
birthday | date | null: false |
profile_photo | string | null: false |
tel_number | string | null: false |
introduction | text |
- has_many :likes
- has_many :products
- has_many :comments
- has_many :cards
- has_one :address
Column | Type | Options |
---|---|---|
name | string | null: false |
explanation | text | null: false |
price | integer | null: false |
brand | string | |
status | integer | null: false |
bear | integer | null: false |
days | integer | null: false |
user_id | integer | foreign_key: true, null: false |
category_id | integer | foreign_key: true, null: false |
- has_many :likes, -> { order(created_at: :desc) }, dependent: :destroy
- has_many :product_photos
- has_many :comments
- belongs_to :category
- belongs_to :user
Column | Type | Options |
---|---|---|
postal_code | integer | null: false |
city | string | null: false |
other | string | null: false |
building_name | string | |
user_id | integer | foreign_key: true, null: false |
- belongs_to :user
Column | Type | Options |
---|---|---|
customer_id | string | null: false |
card_id | string | null: false |
user_id | integer | foreign_key: true, null: false |
- belongs_to :user
Column | Type | Options |
---|---|---|
user | reference | foreign_key: true, null: false |
product_id | integer | foreign_key: true, null: false |
- belongs_to :product
- belongs_to :user
Column | Type | Options |
---|---|---|
photo | string | null: false |
product_id | integer | foreign_key: true, null: false |
- belongs_to :product
Column | Type | Options |
---|---|---|
text | text | null: false |
user | reference | foreign_key: true, null: false |
product_id | integer | foreign_key: true, null: false |
- belongs_to :user
- belongs_to :product
Column | Type | Options |
---|---|---|
name | string | null: false |
ancestry | string | foreign_key: true, null: false |
- has_many :products