== README
#Tables
column | type | Constraint |
---|---|---|
body | text | null:false |
image | string | |
group_id | references | foreign_key: true |
user_id | references | foreign_key: true |
column | type | Constraint |
---|---|---|
name | string | null:false |
string | null:false | |
password | string | null:false |
column | type | Constraint |
---|---|---|
name | string | null:false |
column | type | Constraint |
---|---|---|
group_id | references | foreign_key: true |
user_id | references | foreign_key: true |
:messages, :group_id
:users, :name
:users, :email, unique: true
:groups, :name
:users_groups, [:group_id, :user_id]
#Association
- belongs_to :user
- belongs_to :group
- has_many :messages
- has_many :users_groups
- has_many :groups, through: users_groups
- has_many :messages
- has_many :users_groups
- has_many :users, through: users_groups
- belongs_to :user
- belongs_to :group