Class: Activity::ResourceList::QuoteRetriever

Inherits:
ResourceRetriever show all
Defined in:
app/services/activity/resource_list.rb

Overview

Service object: quote retriever.

Instance Attribute Summary

Attributes inherited from ResourceRetriever

#page, #party, #per_page, #query

Instance Method Summary collapse

Methods inherited from ResourceRetriever

build, #filter_results, #initialize, #total_count

Constructor Details

This class inherits a constructor from Activity::ResourceList::ResourceRetriever

Instance Method Details

#resourcesObject



120
121
122
123
124
125
126
# File 'app/services/activity/resource_list.rb', line 120

def resources
  return unless party.respond_to?(:quotes)

  quotes = party.quotes
  quotes = quotes.where(Quote[:reference_number].matches("%#{query}%")) if query.present?
  filter_results(Quote, quotes)
end