- users
- groups
- group_users
- messages
column | type | constraint |
---|---|---|
name | string | index, unique, null false |
string | unique, null false | |
password | string | null false |
confirmation password | string | null false |
column | type | constraint |
---|---|---|
name | string | unique, null false |
column | type | constraint |
---|---|---|
user_id | integer | foreign_key, index, null false |
group_id | integer | foreign_key, index, null false |
timestamps | time | |
body | text | |
image | text |
column | type |
---|---|
user_id | integer |
group_id | integer |
- has_many :groups, through: :group_users
- has_many :messages
- has_many :users, through: :group_users
- has_many :messages
- belongs_to :user
- belongs_to :group
- belongs_to :group
- belongs_to :user