```ruby
class UserInterest < ApplicationRecord
  belongs_to :user
  belongs_to :interest
end
```

Add validation to UserInterest to prevent redundancy
user
```ruby
class UserInterest < ApplicationRecord
  belongs_to :user
  belongs_to :interest

  validates_uniqueness_of :user_id, scope: [:interest_id]
end
```
assistant