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

alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Squishify

extended

Instance Method Details

#applicable_wellsObject



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

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



51
52
53
54
55
56
# File 'app/models/tag2_layout.rb', line 51

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