Sha256: 7b301aaf2452083f6e3c037eb7482e41727c80d338c30a0b696c59f28726039e

Contents?: true

Size: 465 Bytes

Versions: 10

Compression:

Stored size: 465 Bytes

Contents

module MessageTrain
  class Ignore < ActiveRecord::Base
    belongs_to :participant, polymorphic: true
    belongs_to :conversation, foreign_key: :message_train_conversation_id

    validates_presence_of :conversation, :participant

    scope :find_all_by_participant, ->(participant) { where(participant: participant) }

    def self.conversations
      MessageTrain::Conversation.joins(:ignores).where(message_train_ignores: { id: where(nil) })
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
message_train-0.5.2 app/models/message_train/ignore.rb
message_train-0.5.1 app/models/message_train/ignore.rb
message_train-0.5.0 app/models/message_train/ignore.rb
message_train-0.4.6 app/models/message_train/ignore.rb
message_train-0.4.5 app/models/message_train/ignore.rb
message_train-0.4.4 app/models/message_train/ignore.rb
message_train-0.4.3 app/models/message_train/ignore.rb
message_train-0.4.2 app/models/message_train/ignore.rb
message_train-0.4.1 app/models/message_train/ignore.rb
message_train-0.4.0 app/models/message_train/ignore.rb