Class: DigestEmailItem

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/app/models/digest_email_item.rb

Class Method Summary collapse

Class Method Details

.pending_digest_items_for(receiver_email) ⇒ Object



12
13
14
# File 'lib/app/models/digest_email_item.rb', line 12

def pending_digest_items_for(receiver_email)
  DigestEmailItem.joins(:digest_email_deliveries).where("digest_email_deliveries.sent_at IS NULL AND digest_email_deliveries.receiver_email = ?", receiver_email)
end

.with_group(group) ⇒ Object



8
9
10
# File 'lib/app/models/digest_email_item.rb', line 8

def with_group(group)
  where :digest_email_group_id => group.id
end