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 value_select2.length && query_input.select2('data')
  +          if query_select2.length && 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:       query_input = $("input##{base_id}v_0_value")
        multi_id = query_input.attr('id') + '_multi'
        multi_input = @element.find("##{multi_id}")
        value_select2_id = "#s2id_#{base_id}v_0_value"
        value_select2 = @element.find(value_select2_id)
  
        # Initialize datepicker if column is date/datetime/time
        $.proxy(@init_datetimepicker, this)(base_id)
  
        # Destroy any query select2 inputs on attribute change and clear input
        if value_select2.length
          query_input.val('').select2('destroy')
  
        # Destroy any multi-inputs on attribute change and clear input
        if multi_input.length
          query_input.val('')
          @destroy_multi_input(multi_input, selected_attribute.val())
  
        # Handle association columns with AJAX autocomplete
        if selected_attribute.data('ajax-url') and Select2?
  
negative.code:       attribute_select  = @element.find("select##{base_id}a_0_name")
        selected_attribute = attribute_select.find('option:selected')
  
        query_select2_id = "#s2id_#{base_id}v_0_value"
        query_select2 = @element.find(query_select2_id)
        query_select2_multi_id = "#s2id_#{base_id}v_0_value_multi"
        query_select2_multi = @element.find(query_select2_multi_id)
  
        no_query_predicates = ["true", "false", "blank", "present", "null", "not_null"]
  
        # We need to use a dummy input to handle multiple terms
        multi_id = query_input.attr('id') + '_multi'
        multi_input = @element.find("##{multi_id}")
  
        # If query was previously hidden, clear query input
        if query_select2.length == 0 && multi_input.length == 0 && query_input.is(":hidden")
          query_input.val('')
  
        # Hide query input when not needed
        if p in no_query_predicates
          # If Select2 is on query input, remove and set defaults
          if Select2? && query_select2.length
            query_input.select2('destroy')
  
          query_input.val("true")
          query_input.hide()
          query_input.parent().find('.ui-datepicker-trigger').hide()
  
        if Select2?
          # Turn query input into Select2 tag list when query accepts multiple values
          if p in ["in", "not_in"] || p.match(/_(all|any)$/)
            # Add dummy 'multi' input for select2 if not already added
            if multi_input.length == 0 && query_select2_multi.length == 0
              # Set up multi-query input with fixed options, if present
              @setup_multi_query_input(target, query_input, multi_id, selected_attribute)
  
            # If Select2 is on query input, remove and set defaults
            if query_select2.length
              query_input.select2('destroy').hide()
  
            return
  
          else
            # Otherwise, remove Select2 from multi-query input, and remove input.
            if multi_input.length
              # Save label data from first value
  