* Add MVP of notification subscriptions * Add rate limiting for notification subscriptions * Show modal for logged out users on subscribe click * Add enter key functionality for checkbox * Add relationships for notification subscriptions * Add model test for notification subscription * Deprecated article mutes in favor of notification subscriptions * Deprecated comment mutes in favor of notification subscriptions * Move comment muting tests and logic over * Merge comment and article muting into subscriptions * Remove redundant check * Use database to check for rate limit instead of cache * Test for subscriptions handling notifications properly * Fix notification model spec for subscriptions * Fix tests for subscriptions * Remove rate limiting * Properly handle logged out users getting subscription status * Fix test for new pattern * Update reserved words * Add config column to notification subscriptions * Add logic for top level config and move tests * Test for top level subscribers getting notified * Fix logic mistake oops * Add index and refactor comment_user_ids
13 lines
507 B
Ruby
13 lines
507 B
Ruby
class CreateNotificationSubscriptions < ActiveRecord::Migration[5.2]
|
|
def change
|
|
create_table :notification_subscriptions do |t|
|
|
t.bigint :user_id, null: false
|
|
t.bigint :notifiable_id, null: false
|
|
t.string :notifiable_type, null: false
|
|
t.text :config, null: false, default: "all_comments"
|
|
|
|
t.timestamps
|
|
end
|
|
add_index :notification_subscriptions, %i[notifiable_id notifiable_type config], name: "index_notification_subscriptions_on_notifiable_and_config"
|
|
end
|
|
end
|