Class: UatActions::GenerateTagLayoutTemplate

Inherits:
UatActions
  • Object
show all
Defined in:
app/uat_actions/uat_actions/generate_tag_layout_template.rb

Overview

Will construct a tag layout template from existing tag groups

Constant Summary

Constants inherited from UatActions

CATEGORY_LIST

Instance Method Summary collapse

Methods inherited from UatActions

all, category, default, find, form_field, form_fields, #form_fields, grouped_and_sorted_uat_actions, id, inherited, permitted, #report, #save, to_partial_path, uat_actions

Instance Method Details

#performObject



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'app/uat_actions/uat_actions/generate_tag_layout_template.rb', line 50

def perform
  report[:name] = name
  return true if existing_tag_layout_template

  walk_algorithm = walking_by_algorithm.presence || 'TagLayout::WalkWellsOfPlate'

  tlt_parameters = {
    name: name,
    tag_group_id: tag_group.id,
    tag2_group_id: tag2_group&.id,
    direction_algorithm: direction_algorithm,
    walking_algorithm: walk_algorithm
  }

  tlt = TagLayoutTemplate.create!(tlt_parameters)
  tlt.save
end