Sha256: 2705a16d862863af7c800ec07a963fca221ec51181b49daae4ba06ada4f3ddca
Contents?: true
Size: 537 Bytes
Versions: 8
Compression:
Stored size: 537 Bytes
Contents
module MessageTrain class Ignore < ActiveRecord::Base belongs_to :participant, polymorphic: true belongs_to :conversation validates_presence_of :conversation, :participant scope :find_all_by_participant, ->(participant) { where('participant_type = ? AND participant_id = ?', participant.class.name, participant.id) } def self.conversation_ids all.collect { |y| y.conversation_id } end def self.conversations MessageTrain::Conversation.where('id IN (?)', conversation_ids ) end end end
Version data entries
8 entries across 8 versions & 1 rubygems