Welcome to mirror list, hosted at ThFree Co, Russian Federation.

list_user_preference.rb « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fe1cc7d5425f338b4c3db2cf063f9f6ce90ea459 (plain)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

class ListUserPreference < ApplicationRecord
  belongs_to :user
  belongs_to :list

  validates :user, presence: true
  validates :list, presence: true
  validates :user_id, uniqueness: { scope: :list_id, message: "should have only one list preference per user" }
end