<commit_before>require_dependency "ads/application_controller"

module Ads
  class AdsController < ApplicationController
    
    def index
      ads_types = params[:bt].split(',') if params[:bt]
      ads_count = params[:bc]
      
      if ads_types
        puts "ads_types: #{ads_types}"
        banner_ids = Banner.where(name: ads_types).pluck(:id)
        @ads = Ad.active.includes(:banner).where(banner_id: banner_ids)
        render json: @ads.each_with_object( Hash.new {|h,k| h[k] = [] } ) {|ad, hsh| hsh[ad.banner.name] << {id: ad.id, link: ad_path(ad), image_path: ad.file.url, banner_name: ad.banner.name, } }<commit_msg>Remove puts<commit_after>require_dependency "ads/application_controller"

module Ads
  class AdsController < ApplicationController
    
    def index
      ads_types = params[:bt].split(',') if params[:bt]
      ads_count = params[:bc]
      
      if ads_types
        banner_ids = Banner.where(name: ads_types).pluck(:id)
        @ads = Ad.active.includes(:banner).where(banner_id: banner_ids)
        render json: @ads.each_with_object( Hash.new {|h,k| h[k] = [] } ) {|ad, hsh| hsh[ad.banner.name] << {id: ad.id, link: ad_path(ad), image_path: ad.file.url, banner_name: ad.banner.name, } }
{'fraction_non_alphanumeric': 0.14857142857142858, 'fraction_numerical': 0.0, 'mean_word_length': 3.557620817843866, 'pattern_counts': {'":': 0, '<': 9, '<?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': '508524', 'n_tokens_mistral': 441, 'n_tokens_neox': 435, 'n_words': 84}