Class: UatActions::GenerateTagSet

Inherits:
UatActions show all
Defined in:
app/uat_actions/uat_actions/generate_tag_set.rb

Overview

This UAT action generates a tag set from one or two tag groups.

Constant Summary collapse

ERROR_TAG_GROUP_DOES_NOT_EXIST =
"Tag group '%s' does not exist."
ERROR_TAG2_GROUP_DOES_NOT_EXIST =
"Tag2 group '%s' does not exist."

Constants inherited from UatActions

CATEGORY_LIST

Instance Method Summary collapse

Methods inherited from UatActions

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

Instance Method Details

#performBoolean

Creates a new tag set if it does not already exist. The report is populated with tag set name, tag group name, and tag2 group name of the tag set.

Returns:

  • (Boolean)

    true if the tag set is created or already exists.



41
42
43
44
45
46
# File 'app/uat_actions/uat_actions/generate_tag_set.rb', line 41

def perform
  TagSet.create!(name:, tag_group_name:, tag2_group_name:) if tag_set.blank?
  report.merge!({ name: tag_set.name, tag_group_name: tag_set.tag_group.name,
                  tag2_group_name: tag_set.tag2_group&.name })
  true
end