Column | Type | Options |
---|---|---|
string | null: false | |
password | string | null: false |
name | string | null: false,index: true |
- has_many :users_groups
- has_many :messages
- has_many :groups, through: :users_groups
Column | Type | Options |
---|---|---|
name | string | null: false |
- has_many :messages
- has_many :users_groups
- has_many :users, through: :users_groups
Column | Type | Options |
---|---|---|
user_id | references | null: false, foreign_key: true |
group_id | references | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :group
Column | Type | Options |
---|---|---|
body | text | |
image | string | |
group_id | references | null: false, foreign_key: true |
user_id | references | null: false, foreign_key: true |
- belongs_to :user
- belomgs_to :group