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:       query_input = $("##{base_id}v_0_value")
        multi_id = query_input.attr('id') + '_multi'
        multi_input = @element.find("##{multi_id}")
        query_select2_id = "select##{base_id}v_0_value"
        query_select2 = @element.find(query_select2_id)
        predicate_select2_id = "##{base_id}p"
        predicate_select2 = @element.find(predicate_select2_id)
  
negative.code:           predicates.push [o.val(), o.text()]
          predicate_select.data['predicates'] = predicates
  
      init_select2: (container) ->      
        container.find('select.ransack_predicate').select2
          theme: 'bootstrap'
          formatNoMatches: (term) ->
  