Sha256: 18ca7c83ebba185c96b5138e4633f4e0690e7581240aa4087649dc66763e4609

Contents?: true

Size: 674 Bytes

Versions: 19

Compression:

Stored size: 674 Bytes

Contents

# frozen_string_literal: true
module Thredded
  # Keeps track of post notifications that have been sent already.
  class PostNotification < ActiveRecord::Base
    belongs_to :post, polymorphic: true
    # Specific post type associations for joins
    belongs_to :non_private_post,
               foreign_key:  'post_id',
               foreign_type: 'Thredded::Post',
               class_name:   'Thredded::Post'
    belongs_to :private_post,
               foreign_key:  'post_id',
               foreign_type: 'Thredded::PrivatePost',
               class_name:   'Thredded::PrivatePost'
    validates :email, presence: true
    validates :post, presence: true
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
thredded-0.10.1 app/models/thredded/post_notification.rb
thredded-0.10.0 app/models/thredded/post_notification.rb
thredded-0.9.4 app/models/thredded/post_notification.rb
thredded-0.9.3 app/models/thredded/post_notification.rb
thredded-0.9.2 app/models/thredded/post_notification.rb
thredded-0.9.1 app/models/thredded/post_notification.rb
thredded-0.8.4 app/models/thredded/post_notification.rb
thredded-0.8.2 app/models/thredded/post_notification.rb
thredded-0.7.0 app/models/thredded/post_notification.rb
thredded-0.6.3 app/models/thredded/post_notification.rb
thredded-0.6.2 app/models/thredded/post_notification.rb
thredded-0.6.1 app/models/thredded/post_notification.rb
thredded-0.6.0 app/models/thredded/post_notification.rb
thredded-0.5.1 app/models/thredded/post_notification.rb
thredded-0.5.0 app/models/thredded/post_notification.rb
thredded-0.4.0 app/models/thredded/post_notification.rb
thredded-0.3.2 app/models/thredded/post_notification.rb
thredded-0.3.1 app/models/thredded/post_notification.rb
thredded-0.3.0 app/models/thredded/post_notification.rb