app/logical/bulk_update_request_processor.rb
# Maximum tag size allowed by the rename command before an alias must be used.
Maximum tag size allowed by the rename command before an alias must be used.
Maximum tag size allowed by the rename command before an alias must be used .
def process!(approver)
    ActiveRecord::Base.transaction do
      commands.map do |command, *args|
        case command
        when :create_alias
          TagAlias.approve!(antecedent_name: args[0], consequent_name: args[1], approver: approver, forum_topic: forum_topic)
        when :create_implication
          TagImplication.approve!(antecedent_name: args[0], consequent_name: args[1], approver: approver, forum_topic: forum_topic)
        when :remove_alias
          tag_alias = TagAlias.active.find_by!(antecedent_name: args[0], consequent_name: args[1])
          tag_alias.reject!
        when :remove_implication
          tag_implication = TagImplication.active.find_by!(antecedent_name: args[0], consequent_name: args[1])
          tag_implication.reject!
        when :mass_update
          TagBatchChangeJob.perform_later(args[0], args[1])
        when :nuke
          TagBatchChangeJob.perform_later(args[0], "-#{args[0]}")
        when :rename
          TagRenameJob.perform_later(args[0], args[1])
        when :change_category
          tag = Tag.find_or_create_by_name(args[0])
          tag.update!(category: Tag.categories.value_for(args[1]))
        else
          raise Error, "Unknown command: #{command}"
        end
      end
    end
  end
def process! ( approver ) ActiveRecord :: Base . transaction do commands . map do | command , * args | case command when :create_alias TagAlias . approve! ( antecedent_name : args [ 0 ] , consequent_name : args [ 1 ] , approver : approver , forum_topic : forum_topic ) when :create_implication TagImplication . approve! ( antecedent_name : args [ 0 ] , consequent_name : args [ 1 ] , approver : approver , forum_topic : forum_topic ) when :remove_alias tag_alias = TagAlias . active . find_by! ( antecedent_name : args [ 0 ] , consequent_name : args [ 1 ] ) tag_alias . reject! when :remove_implication tag_implication = TagImplication . active . find_by! ( antecedent_name : args [ 0 ] , consequent_name : args [ 1 ] ) tag_implication . reject! when :mass_update TagBatchChangeJob . perform_later ( args [ 0 ] , args [ 1 ] ) when :nuke TagBatchChangeJob . perform_later ( args [ 0 ] , "-#{args[0]}" ) when :rename TagRenameJob . perform_later ( args [ 0 ] , args [ 1 ] ) when :change_category tag = Tag . find_or_create_by_name ( args [ 0 ] ) tag . update! ( category : Tag . categories . value_for ( args [ 1 ] ) ) else raise Error , "Unknown command: #{command}" end end end end
Maximum tag size allowed by the rename command before an alias must be used.
Maximum tag size allowed by the rename command before an alias must be used .
# should never happen
approver