zips all users with newsletter activated

This commit is contained in:
rgarcia
2016-04-18 03:53:23 +02:00
committed by Bertocq
parent 2a7ff2270e
commit 8f4eec2b8e
2 changed files with 4 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ class User < ActiveRecord::Base
scope :moderators, -> { joins(:moderator) }
scope :organizations, -> { joins(:organization) }
scope :officials, -> { where("official_level > 0") }
scope :newsletter, -> { where(newsletter: true) }
scope :for_render, -> { includes(:organization) }
scope :by_document, -> (document_type, document_number) { where(document_type: document_type, document_number: document_number) }
scope :email_digest, -> { where(email_digest: true) }