Module: ModelExtensions::Well

Included in:
Well
Defined in:
app/api/model_extensions/well.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/api/model_extensions/well.rb', line 2

def self.included(base)
  base.class_eval do
    scope :for_api_plate_json, -> {
      preload(
        :map,
        :transfer_requests_as_target, # Should be :transfer_requests_as_target
        # :uuid_object is included elsewhere, and trying to also include it here
        # actually disrupts the eager loading.
        plate: :uuid_object,
        aliquots: Io::Aliquot::PRELOADS
      )
    }
  end
end

Instance Method Details

#legacy_asset_typeObject

Compatibility for v1 API maintains legacy 'type' for assets


18
19
20
# File 'app/api/model_extensions/well.rb', line 18

def legacy_asset_type
  labware.sti_type
end