##usersテーブル
Column | Type | Opinion |
---|---|---|
product | references | foreign_key:true |
comment | references | foreign_key:true |
name | string | null:false,unique:true |
adress | text | null:false |
age | integer | null:false |
gender | string | null:false |
tel | integer | null:false |
Association
・has_many :comments
・has_many :products
##commentsテーブル
Column | Type | Opinion |
---|---|---|
body | text | null:false |
rate | integer | null:false |
product | references | foreign_key:true |
user | references | foreign_key:true |
Association
・belongs_to :user
・belongs_to :product