column | Type | Option |
---|---|---|
name | string | null: false, unique: true |
varchar | null: false, unique: true | |
password | varchar | null: false, |
- has_many : groups,through: group_users
- has_many : messages
- has_many : group_users
column | Type | Option |
---|---|---|
name | string | null: false, unique: true |
- has_many : users,through: group_users
- has_many : messages
- has_many : group_users
column | Type | Option |
---|---|---|
group_id | integer | null: false, foreign_key: true |
user_id | integer | null: false, foreign_key: true |
- belongs_to : user
- belongs_to : group
column | Type | Option |
---|---|---|
body | text | |
image | string | |
group_id | integer | null: false, foreign_key: true |
user_id | integer | null: false, foreign_key: true |
- belongs_to : user
- belongs_to : group