Class: JsonApiResource::Associations::Preloaders::HasManyPrefetchedPreloader
- Inherits:
-
Base
- Object
- Base
- JsonApiResource::Associations::Preloaders::HasManyPrefetchedPreloader
show all
- Defined in:
- lib/json_api_resource/associations/preloaders/has_many_prefetched_preloader.rb
Instance Attribute Summary
Attributes inherited from Base
#association, #distributor
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #preload
Instance Method Details
#bulk_query(objects) ⇒ Object
6
7
8
9
|
# File 'lib/json_api_resource/associations/preloaders/has_many_prefetched_preloader.rb', line 6
def bulk_query( objects )
ids = objects.map{ |o| o.send(key) }.flatten.uniq
{ id: ids }.merge(opts)
end
|
#distributor_class ⇒ Object
#safe?(query) ⇒ Boolean
11
12
13
|
# File 'lib/json_api_resource/associations/preloaders/has_many_prefetched_preloader.rb', line 11
def safe?( query )
query[:id].present?
end
|