Class: Tag2Layout

Inherits:
ApplicationRecord show all
Includes:
Uuid::Uuidable
Defined in:
app/models/tag2_layout.rb

Overview

Lays out the tags in the specified tag group in a particular pattern.

Applies a single tag 2 to the entire plate

Defined Under Namespace

Classes: TemplateSubmission

Instance Method Summary collapse

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Method Details

#applicable_wellsObject


41
42
43
44
45
46
47
# File 'app/models/tag2_layout.rb', line 41

def applicable_wells
  if attributes['target_well_locations']
    plate.wells.located_at(attributes['target_well_locations']).include_aliquots
  else
    plate.wells.include_aliquots
  end
end

#layout_tag2_into_wellsObject


49
50
51
52
53
54
# File 'app/models/tag2_layout.rb', line 49

def layout_tag2_into_wells
  applicable_wells.each do |well|
    well.assign_tag2(tag)
    well.set_as_library
  end
end