Module: Api::BatchRequestIO::Extensions

Included in:
BatchRequest
Defined in:
app/models/api/batch_request_io.rb

Overview

rubocop:todo Style/Documentation

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/models/api/batch_request_io.rb', line 12

def self.included(base)
  base.class_eval do
    extend ClassMethods

    scope :including_associations_for_json,
          lambda {
            includes(
              [
                :uuid_object,
                { request: [:uuid_object, :request_type, { asset: :uuid_object }, { target_asset: :uuid_object }] },
                { batch: :uuid_object }
              ]
            )
          }
  end
end