mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 21:26:07 +10:00
9 lines
234 B
Ruby
9 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
|