Sha256: c4aa7668162b495021a56e5f34235cde5132d7cfe1ff594df2a452299a4d72be
Contents?: true
Size: 583 Bytes
Versions: 1
Compression:
Stored size: 583 Bytes
Contents
class Receipt < ActiveRecord::Base belongs_to :message belongs_to :sender, :class_name => Messaging.config.user_class.to_s belongs_to :recipient, :class_name => Messaging.config.user_class.to_s validates :receiver, :presence => true scope :trash, -> { where(:trash => true) } scope :inbox, -> { where(:trash => false) } scope :read, -> { where(:read => true) } scope :unread, -> { where(:unread => true) } scope :to -> (receiver) { where(:recipient_id => receiver.id) } scope :from -> (initiator) { where(:sender_id => initiator.id) } end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
messaging-0.0.2 | app/models/receipt.rb |