Class: Quotes::UnopenedQuoteFinder
- Inherits:
-
BaseService
- Object
- BaseService
- Quotes::UnopenedQuoteFinder
- Defined in:
- app/services/quotes/unopened_quote_finder.rb
Overview
Service object: unopened quote finder.
Instance Method Summary collapse
Instance Method Details
#process(age_of_quote = nil) ⇒ Object
4 5 6 7 |
# File 'app/services/quotes/unopened_quote_finder.rb', line 4 def process(age_of_quote = nil) age_of_quote ||= 24.hours.ago 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 |