Module: Serega::SeregaPlugins::Batch
- Defined in:
- lib/serega/plugins/batch/batch.rb,
lib/serega/plugins/batch/lib/loader.rb,
lib/serega/plugins/batch/lib/loaders.rb,
lib/serega/plugins/batch/lib/plugins_extensions.rb,
lib/serega/plugins/batch/lib/validations/check_opt_batch.rb,
lib/serega/plugins/batch/lib/validations/check_batch_opt_key.rb,
lib/serega/plugins/batch/lib/validations/check_batch_opt_loader.rb
Defined Under Namespace
Modules: AttributeInstanceMethods, CheckAttributeParamsInstanceMethods, ClassMethods, ConfigInstanceMethods, MapPointInstanceMethods, PluginsExtensions, SeregaObjectSerializerInstanceMethods, SeregaSerializerInstanceMethods
Classes: BatchLoadersConfig, BatchModel, CheckBatchOptKey, CheckBatchOptLoader, CheckOptBatch, SeregaBatchLoader, SeregaBatchLoaders
Class Method Summary
collapse
Class Method Details
.after_load_plugin(serializer_class, **opts) ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/serega/plugins/batch/batch.rb', line 25
def self.after_load_plugin(serializer_class, **opts)
config = serializer_class.config
config.attribute_keys << :batch
config.opts[:batch] = {loaders: {}}
serializer_class::SeregaConfig.include(ConfigInstanceMethods)
batch_loaders_class = Class.new(SeregaBatchLoaders)
batch_loaders_class.serializer_class = serializer_class
serializer_class.const_set(:SeregaBatchLoaders, batch_loaders_class)
batch_loader_class = Class.new(SeregaBatchLoader)
batch_loader_class.serializer_class = serializer_class
serializer_class.const_set(:SeregaBatchLoader, batch_loader_class)
if serializer_class.plugin_used?(:activerecord_preloads)
require_relative "./lib/plugins_extensions"
serializer_class::SeregaBatchLoader.include(PluginsExtensions::ActiveRecordPreloads::BatchLoaderInstanceMethods)
end
if serializer_class.plugin_used?(:formatters)
require_relative "./lib/plugins_extensions"
serializer_class::SeregaBatchLoader.include(PluginsExtensions::Formatters::BatchLoaderInstanceMethods)
end
end
|
.load_plugin(serializer_class, **_opts) ⇒ Object
.plugin_name ⇒ Object
6
7
8
|
# File 'lib/serega/plugins/batch/batch.rb', line 6
def self.plugin_name
:batch
end
|