debian-mirror-gitlab/app/models/list_user_preference.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
299 B
Ruby
Raw Normal View History

2019-12-04 20:38:33 +05:30
# 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