Sha256: 5cfc4151e11db4e895ea05bbe39ecf10d601a38a0c85dc74b1794aff12ea8c1f
Contents?: true
Size: 672 Bytes
Versions: 24
Compression:
Stored size: 672 Bytes
Contents
require_dependency "renalware/messaging" module Renalware module Messaging module Internal class Receipt < ApplicationRecord validates :recipient, presence: true validates :message, presence: true belongs_to :message belongs_to :recipient scope :unread, -> { where(read_at: nil) } scope :read, -> { where.not(read_at: nil) } scope :ordered, -> { joins(:message).merge(Message.ordered) } scope :sent_by, lambda{ |user_id| joins(:message).where(messaging_messages: { author_id: user_id }) } def read? read_at.present? end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems