<commit_before># frozen_string_literal: true
ActiveAdmin.register EventInstance do
  menu parent: 'Events'

  show do
    attributes_table do
      row :address
      row :event
      row :start_time
      row :end_time
      row :details
      row :cost
      row :description
      row :image_url do |instance|
        image_tag instance.image_url
      end
      row :leaders do |instance|
        p instance.leaders.map{|leader| "#{leader.member.first_name} #{leader.member.last_name}"}.join(", ")
      end
    end
    panel :attendees do
      table_for event_instance.attendees do
        column :first_name do |attendee|
          attendee.member.first_name
        end
        column :last_name do |attendee|
          attendee.member.last_name
        end
        column :email do |attendee|
          attendee.member.email
        end
        column :phone do |attendee|
          attendee.member.phone1
        end
        column :created_at
      end
    end
  end

  form title: 'Creating / Updating' do |f|
    inputs 'Details' do
      input :event
      input :address<commit_msg>Fix nil exception<commit_after># frozen_string_literal: true
ActiveAdmin.register EventInstance do
  menu parent: 'Events'

  show do
    attributes_table do
      row :address
      row :event
      row :start_time
      row :end_time
      row :details
      row :cost
      row :description
      row :image_url do |instance|
        image_tag instance.image_url
      end
      row :leaders do |instance|
        p instance.leaders&.map{|leader| "#{leader.member&.first_name} #{leader.member&.last_name}"}.join(", ")
      end
    end
    panel :attendees do
      table_for event_instance.attendees do
        column :first_name do |attendee|
          attendee.member&.first_name
        end
        column :last_name do |attendee|
          attendee.member&.last_name
        end
        column :email do |attendee|
          attendee.member&.email
        end
        column :phone do |attendee|
          attendee.member&.phone1
        end
        column :created_at
      end
    end
  end

  form title: 'Creating / Updating' do |f|
    inputs 'Details' do
      input :event
      input :address
{'fraction_non_alphanumeric': 0.07573696145124717, 'fraction_numerical': 0.0009070294784580499, 'mean_word_length': 2.0511756569847854, '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': '2615194', 'n_tokens_mistral': 668, 'n_tokens_neox': 663, 'n_words': 185}