Module: Caoutsearch::Search::Records
- Included in:
- Base
- Defined in:
- lib/caoutsearch/search/records.rb
Instance Method Summary collapse
Instance Method Details
#records(use: nil, skip_query_cache: false) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/caoutsearch/search/records.rb', line 6 def records(use: nil, skip_query_cache: false) if use records_adapter.call(use, hits, skip_query_cache: skip_query_cache) else @records ||= records_adapter.call(model, hits) end end |
#records_adapter ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/caoutsearch/search/records.rb', line 14 def records_adapter if defined?(ActiveRecord::Base) Adapter::ActiveRecord else raise NotImplementedError end end |