I need to show posts from users who have an active subscription.

**model/user.rb**

```
has_one :profile, dependent: :destroy
has_many :posts, dependent: :destroy

```

**model/profile.rb ->suscription**

```
belongs_to :user, dependent: :destroy
scope :active, -> (as_of_date = Date.current) { where('? BETWEEN start_suscription AND end_suscription', as_of_date) } // return true is active

```

**model/post.rb**

```
belongs_to :user, dependent: :destroy

```

how do I do the query?