Sha256: 4cff08218eee8850939be22ef40f2a38dbecfbf204e3fbc7b08500b7ba3ff4e9

Contents?: true

Size: 739 Bytes

Versions: 10

Compression:

Stored size: 739 Bytes

Contents

# frozen_string_literal: true
module Thredded
  class NotificationsForFollowedTopics < ActiveRecord::Base
    belongs_to :user,
               class_name: Thredded.user_class,
               inverse_of: :thredded_notifications_for_followed_topics
    belongs_to :messageboard # or is global
    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

10 entries across 10 versions & 1 rubygems

Version Path
thredded-0.12.1 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.12.0 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.11.1 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.11.0 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.10.1 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.10.0 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.9.4 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.9.3 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.9.2 app/models/thredded/notifications_for_followed_topics.rb
thredded-0.9.1 app/models/thredded/notifications_for_followed_topics.rb