Class: JsonApiResource::Associations::Preloaders::HasManyPreloader
- Inherits:
-
Base
- Object
- Base
- JsonApiResource::Associations::Preloaders::HasManyPreloader
show all
- Defined in:
- lib/json_api_resource/associations/preloaders/has_many_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_preloader.rb', line 6
def bulk_query( objects )
ids = objects.map(&:id)
{ key => ids }.merge(opts)
end
|
#distributor_class ⇒ Object
#safe?(query) ⇒ Boolean
11
12
13
|
# File 'lib/json_api_resource/associations/preloaders/has_many_preloader.rb', line 11
def safe?( query )
query[key].present?
end
|