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

subscription.rb « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2f0c964074494d33a31120304fd1e82b3226d7cc (plain)
1
2
3
4
5
6
7
8
9
class Subscription < ActiveRecord::Base
  belongs_to :user
  belongs_to :project
  belongs_to :subscribable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations

  validates :user, :subscribable, presence: true

  validates :project_id, uniqueness: { scope: [:subscribable_id, :subscribable_type, :user_id] }
end