Class: Quotes::UnopenedQuoteFinder
- Inherits:
-
BaseService
- Object
- BaseService
- Quotes::UnopenedQuoteFinder
- Defined in:
- app/services/quotes/unopened_quote_finder.rb
Instance Method Summary collapse
Instance Method Details
#process(age_of_quote = nil) ⇒ Object
3 4 5 6 |
# File 'app/services/quotes/unopened_quote_finder.rb', line 3 def process(age_of_quote = nil) age_of_quote ||= 24.hours.ago quotes = Quote.completed_quotes.last_revisions.where.not(complete_datetime:nil).where(Quote[:complete_datetime].gteq(age_of_quote)).joins(:communications => :communication_recipients).where.not(CommunicationRecipient[:state].eq('opened')).where(CommunicationRecipient[:email_method].eq('to')) end |