anchor.diff:          # Handle association columns with AJAX autocomplete
           if selected_attribute.data('ajax-url')
             # Set label to single association label, if anything was selected
  -          if query_select2.length && query_input.select2('data')
  +          if $(query_input).hasClass("select2-hidden-accessible") && query_input.select2('data')
               query_input_data = query_input.select2('data')
               Ransack.value_field_labels[selected_attribute.val()] ||= {}
               Ransack.value_field_labels[selected_attribute.val()][query_input_data.id] = query_input_data.text
  
positive.code:       # Destroy any query select2 inputs on attribute change and clear input
        if query_select2.length
          id = query_input.attr("id")
  
          query_input.select2('destroy')
          query_input.replaceWith("<input type='text' name='#{query_input.attr("name")}' id='#{query_input.attr("id")}'
          class='#{query_input.attr("class")}'>
          </input>");
  
          query_input = $("##{id}")
  
        # Destroy any multi-inputs on attribute change and clear input
        if multi_input.length
  
negative.code:             @setup_multi_query_input(target, query_input, multi_id, selected_attribute)
  
            # If Select2 is on query input, remove and set defaults
            if $(query_input).hasClass("select2-hidden-accessible")
              query_input.select2('destroy').hide()
  
            return
  