class UserInterest < ApplicationRecord
  belongs_to :user
  belongs_to :interest
end

class UserInterest < ApplicationRecord
  belongs_to :user
  belongs_to :interest

  validates_uniqueness_of :user_id, scope: [:interest_id]
end

Add validation to UserInterest to prevent redundancy
Add validation to UserInterest to prevent redundancy
