Module: Api::LibraryTubeIO::Extensions

Included in:
LibraryTube
Defined in:
app/models/api/library_tube_io.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


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

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

    scope :including_associations_for_json, -> {
      includes([
        :uuid_object,
        :barcodes, {
          source_request: [:uuid_object, :request_metadata],
          primary_aliquot: { sample: :uuid_object, tag: [:uuid_object, { tag_group: :uuid_object }] }
        },
        :scanned_into_lab_event
      ])
    }
  end
end

Instance Method Details

#json_rootObject


28
29
30
# File 'app/models/api/library_tube_io.rb', line 28

def json_root
  'library_tube'
end