Sha256: aa9b48232bd6611901c50a0d08b869dabbac82174ee3a0557ee65996b4bd4089

Contents?: true

Size: 876 Bytes

Versions: 23

Compression:

Stored size: 876 Bytes

Contents

# frozen_string_literal: true

module Thredded
  class NotificationsForFollowedTopics < ActiveRecord::Base
    belongs_to :user,
               class_name: Thredded.user_class_name,
               inverse_of: :thredded_notifications_for_followed_topics
    belongs_to :messageboard,
               # If messageboard is `nil`, these are the global preferences.
               **(Thredded.rails_gte_51? ? { optional: true } : {})
    belongs_to :user_preference,
               primary_key: :user_id,
               foreign_key: :user_id,
               inverse_of: :notifications_for_followed_topics

    validates :user_id, presence: true

    include Thredded::NotifierPreference

    def self.default(_notifier)
      # could be moved to  `notifier.defaults(:notifications_for_followed_topics)`
      Thredded::BaseNotifier::NotificationsDefault.new(true)
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
thredded-0.16.16 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.15 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.14 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.13 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.12 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.11 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.10 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.9 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.8 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.7 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.6 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.5 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.4 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.3 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.1 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.16.0 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.15.5 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.15.4 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.15.3 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.15.2 app/models/thredded/notifications_for_followed_topics.rb