Skip to content

Subscription ​

The relation between a subscriber and a list. Unsubscribing suppresses the subscription instead of destroying it.

Columns ​

ColumnTypeNotes
subscriber_idbigintrequired
list_idbigintrequired
suppressed_attimestampsee Suppressible
suppression_reasonintegerenum, see Suppressible

Unique index on [subscriber_id, list_id].

Included concerns ​

Suppressible

Associations ​

  • belongs_to :subscriber
  • belongs_to :list, counter_cache: :subscriptions_count

Validations ​

  • list uniqueness per subscriber ("should be subscribed once per subscriber")

Released under the MIT License.