Subscription
The relation between a subscriber and a list. Unsubscribing suppresses the subscription instead of destroying it.
Columns
| Column | Type | Notes |
|---|---|---|
subscriber_id | bigint | required |
list_id | bigint | required |
suppressed_at | timestamp | see Suppressible |
suppression_reason | integer | enum, see Suppressible |
Unique index on [subscriber_id, list_id].
Included concerns
Associations
belongs_to :subscriberbelongs_to :list, counter_cache: :subscriptions_count
Validations
listuniqueness per subscriber ("should be subscribed once per subscriber")