gitlab-org--gitlab-foss/app/models/subscription.rb

9 lines
234 B
Ruby
Raw Normal View History

class Subscription < ActiveRecord::Base
2015-03-16 09:35:48 -04:00
belongs_to :user
belongs_to :subscribable, polymorphic: true
validates :user_id,
2015-03-16 09:35:48 -04:00
uniqueness: { scope: [:subscribable_id, :subscribable_type] },
presence: true
end