debian-mirror-gitlab/app/models/subscription.rb
2016-06-02 11:05:42 +05:30

8 lines
234 B
Ruby

class Subscription < ActiveRecord::Base
belongs_to :user
belongs_to :subscribable, polymorphic: true
validates :user_id,
uniqueness: { scope: [:subscribable_id, :subscribable_type] },
presence: true
end