Column | Type | Options |
---|---|---|
user_id | integer | null: false, foreign_key: true |
group_id | integer | null: false, foreign_key: true |
- belongs_to :group
- belongs_to :user
Column | Type | Options |
---|---|---|
name | string | null: false |
- has_many :users, though: :groups_users
- has_many :messages
- has_many :groups_users
Column | Type | Options |
---|---|---|
string | null: false | |
password | string | null: false |
name | string | null: false |
- has_many :groups, though: :groups_users
- has_many :messages
- has_many :groups_users
Column | Type | Options |
---|---|---|
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