<commit_before>class DistributionPluginProductController < DistributionPluginMyprofileController
  no_design_blocks

  before_filter :set_admin_action, :only => [:index]

  helper DistributionPlugin::DistributionProductHelper

  def index
    @supplier = DistributionPluginSupplier.find_by_id params[:supplier_id].to_i
    not_distributed_products

    conditions = []
    conditions += ['active = ?', params["active"]] unless params["active"].blank?
    conditions += ['supplier_id = ?', params["supplier_id"]] unless params["supplier_id"].blank?
    conditions += ['LOWER(name) LIKE ?', '%'+params["name"]+'%'] unless params["name"].blank?
    conditions = DistributionPluginDistributedProduct.send :merge_conditions, conditions
<commit_msg>Close bug filtering products<commit_after>class DistributionPluginProductController < DistributionPluginMyprofileController
  no_design_blocks

  before_filter :set_admin_action, :only => [:index]

  helper DistributionPlugin::DistributionProductHelper

  def index
    @supplier = DistributionPluginSupplier.find_by_id params[:supplier_id].to_i
    not_distributed_products

    conditions = ['', []]
     if not params["active"].blank?
       conditions = ['active = ?', [params["active"]]]
     end
     if not params["supplier_id"].blank?
       conditions[0] += ' AND ' unless conditions[0].blank?
       conditions[0] += 'supplier_id = ?'
       conditions[1] += [params["supplier_id"]]
     end
     if not params['name'].blank?
       conditions[0] += ' AND ' unless conditions[0].blank?
       conditions[0] += 'LOWER(name) LIKE ?'
       conditions[1] += ['%'+params["name"]+'%']
     end
    conditions = DistributionPluginDistributedProduct.send :merge_conditions, conditions.flatten


{'fraction_non_alphanumeric': 0.12931034482758622, 'fraction_numerical': 0.004597701149425287, 'mean_word_length': 4.921768707482993, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '260857', 'n_tokens_mistral': 489, 'n_tokens_neox': 475, 'n_words': 93}