Column | Type | Options |
---|---|---|
user | references | null: false, foreign_key: true |
group | references | null: false, foreign_key: true |
- belongs_to :group
- belongs_to :user
Column | Type | Options |
---|---|---|
name | string | null: false, unique: true,index: true |
string | null: false, unique: true | |
pass | integer | null: false |
- has_many:groups, through: :groups_users
- has_many:messages
- has_many:groups_users
Column | Type | Options |
---|---|---|
name | string | null: false |
- has_many:users, through: :groups_users
- has_many:messages
- has_many:groups_users
Column | Type | Options |
---|---|---|
message | text | |
image | string | |
user | references | null: false, foreign_key: true |
group | references | null: false, foreign_key: true |
- belongs_to :group
- belongs_to :user