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

9 lines
234 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
class Subscription < ActiveRecord::Base
belongs_to :user
belongs_to :subscribable, polymorphic: true
2016-06-02 11:05:42 +05:30
validates :user_id,
2015-04-26 12:48:37 +05:30
uniqueness: { scope: [:subscribable_id, :subscribable_type] },
presence: true
end