Column | Type | Options |
---|---|---|
name | string | null: false, index: true |
-
has_many messages
-
has_many members
-
has_many groups, through :members
Column | Type | Options |
---|---|---|
group_id | references | null: false, foreign_key: true |
user_id | references | null: false, foreign_key: true |
-
belongs_to group
-
belongs_to user
Column | Type | Options |
---|---|---|
name | string | null: false |
-
has_many members
-
has_many messages
-
has_many users, through: members
Column | Type | Options |
---|---|---|
text | text | |
image | text | |
created_at | timestamp | null: false |
user_id | references | null: false, foreign_key: true |
group_id | references | null: false, foreign_key: true |
-
belongs_to user
-
belongs_to group