<commit_before>module SlavePoolsModule
  # Implements the methods expected by the QueryCache module
  module QueryCacheCompat

    def select_all(*a, &b)
      if @query_cache_enabled
        cache_sql(a.first, a.last) {send_to_current(:select_all, *a, &b)}
      else
        send_to_current(:select_all, *a, &b)
      end
    end
    
    def columns(*a, &b)
      if @query_cache_enabled
        cache_sql(a.first, a.last) {send_to_current(:columns, *a, &b)}
      else
        send_to_current(:columns, *a, &b)
      end
    end
    
    def insert(*a, &b)
      clear_query_cache if @query_cache_enabled
      send_to_master(:insert, *a, &b)
    end
    
    def update(*a, &b)
      clear_query_cache if @query_cache_enabled
      send_to_master(:update, *a, &b)
    end
    
    def delete(*a, &b)
      clear_query_cache if @query_cache_enabled
      send_to_master(:delete, *a, &b)<commit_msg>rails 3.2.* compatibility: fixing select_all method in QueryCacheCompat to properly form cache key<commit_after>module SlavePoolsModule
  # Implements the methods expected by the QueryCache module
  module QueryCacheCompat

    def select_all(*a, &b)
      if @query_cache_enabled
        arel, name, binds = a
        sql = to_sql(arel, binds)
        cache_sql(sql, binds) {send_to_current(:select_all, *a, &b)}
      else
        send_to_current(:select_all, *a, &b)
      end
    end
    
    def columns(*a, &b)
      if @query_cache_enabled
        cache_sql(a.first, a.last) {send_to_current(:columns, *a, &b)}
      else
        send_to_current(:columns, *a, &b)
      end
    end
    
    def insert(*a, &b)
      clear_query_cache if @query_cache_enabled
      send_to_master(:insert, *a, &b)
    end
    
    def update(*a, &b)
      clear_query_cache if @query_cache_enabled
      send_to_master(:update, *a, &b)
    end
    
    def delete(*a, &b)
      clear_query_cache if @query_cache_enabled
      send_to_master(:delete, *a, &b)
{'fraction_non_alphanumeric': 0.10420944558521561, 'fraction_numerical': 0.001026694045174538, 'mean_word_length': 2.7337164750957856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3208073', 'n_tokens_mistral': 684, 'n_tokens_neox': 674, 'n_words': 164}