I am trying to build a relationship basically as follows:

Group Model

```
has_and_belongs_to_many :users
has_many :posts

```

User Model

```
has_and_belongs_to_many :groups
has_many :posts

```

Post Model

```
belongs_to :group
belongs_to :user

```

When I query about posts by the user, I can do user.posts. However, I can't figure out how to query all posts from the groups that the user joined. Any suggestion is appreciated!