You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: copy.rb
    path of file: ./repos/manageiq/app/models/service_template
    
    the code of the file until where you have to start completion: module ServiceTemplate::Copy
  extend ActiveSupport::Concern

  def template_copy(new_name = "Copy of " + name + Time.zone.now.to_s, copy_tags: false)
    if template_valid? && type != 'ServiceTemplateAnsiblePlaybook'
      ActiveRecord::Base.transaction do
        dup.tap do |template|
          template.update!(:name => new_name, :display => false, :options => {:button_order => []})
          service_resources.each { |service_resource| resource_copy(service_resource, template) }
          resource_action_copy(template)
          additional_tenant_copy(template)
          picture_copy(te
    
  def template_copy(new_name = "Copy of " + name + Time.zone.now.to_s, copy_tags: false)
    if template_valid? && type != 'ServiceTemplateAnsiblePlaybook'
      ActiveRecord::Base.transaction do
        dup.tap do |template|
          template.update!(:name => new_name, :display => false, :options => {:button_order => []})
          service_resources.each { |service_resource| resource_copy(service_resource, template) }
          resource_action_copy(template)
          additional_tenant_copy(template)
          picture_copy(template) if picture
          tags_copy(template) if copy_tags
          direct_custom_buttons.each { |custom_button| custom_button_copy(custom_button, template) }
          custom_button_sets.each { |custom_button_set| custom_button_set_copy(custom_button_set, template) }
          template.save!
        end
      end
    end