<commit_before>ActiveAdmin.register Company do
  permit_params :name, :slug, :url, :logo, :pledged_support

  index do
    selectable_column
    id_column
    column :name
    column :slug
    column :url
    column(:logo) do |resource|
      image_tag resource.logo.url(:small), height: 20 if resource.logo?
    end
    column 'Подкр.?', :pledged_support
    column 'Събития', sortable: :events_count do |row|
      if row.events_count > 0
        link_to "#{row.events_count} (виж)", admin_events_path(q: {speaker_company_id_eq: row.id})
      end
    end
    column 'Лектори', sortable: :speakers_count do |row|
      if row.speakers_count > 0
        link_to "#{row.speakers_count} (виж)", admin_speakers_path(q: {company_id_eq: row.id})
      end
    end
    column :created_at
    column :updated_at
    actions
  end

  filter :name
  filter :slug
  filter :url
  filter :pledged_support
  filter :created_at

  form do |f|
    f.inputs 'Информация за фирма' do
      f.input :name
      f.input :slug
      f.input :url
      f.input :logo
      f.input :pledged_support
    end
    f.actions
  end

  show do |resource|
    panel 'Информация за фирма' do
      attributes_table_for resource do
        row :id
        row :name
        row :slug
        row :url do
          link_to resource.url if resource.url.present?
        end
        row :logo do
          if resource.logo?
            link_to resource.logo.url(:original), target: '_blank' do
              image_tag resource.logo.url(:medium)
            end
          end
        end
        row :pledged_support
        row :created_at
        row :updated_at
      end
    end
    active_admin_comments
  end
end<commit_msg>Fix the company's link in the admin<commit_after>ActiveAdmin.register Company do
  permit_params :name, :slug, :url, :logo, :pledged_support

  index do
    selectable_column
    id_column
    column :name
    column :slug
    column :url
    column(:logo) do |resource|
      image_tag resource.logo.url(:small), height: 20 if resource.logo?
    end
    column 'Подкр.?', :pledged_support
    column 'Събития', sortable: :events_count do |row|
      if row.events_count > 0
        link_to "#{row.events_count} (виж)", admin_events_path(q: {speaker_company_id_eq: row.id})
      end
    end
    column 'Лектори', sortable: :speakers_count do |row|
      if row.speakers_count > 0
        link_to "#{row.speakers_count} (виж)", admin_speakers_path(q: {company_id_eq: row.id})
      end
    end
    column :created_at
    column :updated_at
    actions
  end

  filter :name
  filter :slug
  filter :url
  filter :pledged_support
  filter :created_at

  form do |f|
    f.inputs 'Информация за фирма' do
      f.input :name
      f.input :slug
      f.input :url
      f.input :logo
      f.input :pledged_support
    end
    f.actions
  end

  show do |resource|
    panel 'Информация за фирма' do
      attributes_table_for resource do
        row :id
        row :name
        row :slug
        row :url do
          link_to resource.url, resource.url if resource.url.present?
        end
        row :logo do
          if resource.logo?
            link_to resource.logo.url(:original), target: '_blank' do
              image_tag resource.logo.url(:medium)
            end
          end
        end
        row :pledged_support
        row :created_at
        row :updated_at
      end
    end
    active_admin_comments
  end
end
{'fraction_non_alphanumeric': 0.08309037900874636, 'fraction_numerical': 0.0023323615160349854, 'mean_word_length': 2.2155576382380504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5680383', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1145, 'n_words': 314}