テーブル設計
users テーブル
Column |
Type |
Options |
email |
string |
null: false |
encrypted_password |
string |
null: false |
name |
string |
null: false |
profile |
text |
null: false |
occupation |
text |
null: false |
position |
text |
null: false |
- has_many :prototypes
- has_many :comments, through: :prototypes
prototypes テーブル
Column |
Type |
Options |
title |
string |
null: false |
catch_copy |
text |
null: false |
concept |
text |
null: false |
user |
references |
null: false, foreign_key: true |
- has_many :comments, through: :users
comments テーブル
| content | text | null: false |
| prototype | references | null: false, foreign_key: true |
| user | references | null: false, foreign_key: true |
- belongs_to :prototype
- belongs_to :user