```ruby
class ChannelMember < ActiveRecord::Base
  belongs_to :channel
  belongs_to :user
  validates :user_id, :channel_id, presence: true
end
```

Add uniqueness validation to user on channel member
user
```ruby
class ChannelMember < ActiveRecord::Base
  belongs_to :channel
  belongs_to :user
  validates :user_id, :channel_id, presence: true
  validate :user_id, uniqueness: true
end
```
assistant