summaryrefslogtreecommitdiff
path: root/app/models/subscription.rb
blob: 3b8aa1eb8669bec2cb090f3257cf6fc2780de4e5 (plain)
1
2
3
4
5
6
7
8
class Subscription < ActiveRecord::Base
  belongs_to :user
  belongs_to :subscribable, polymorphic: true

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