class RelatedContentScore < ActiveRecord::Base
  belongs_to :related_content, touch: true, counter_cache: :related_content_scores_count

  validates :user_id, presence: true
  validates :related_content_id, presence: true
end

class RelatedContentScore < ActiveRecord::Base
  belongs_to :related_content, touch: true, counter_cache: :related_content_scores_count
  belongs_to :user

  validates :user, presence: true
  validates :related_content, presence: true
  validates :related_content_id, uniqueness: { scope: [:user_id] }
end

Fix Related Content Score presence validations and unique composed key
Fix Related Content Score presence validations and unique composed key
