<commit_before># frozen_string_literal: true

class Event < ActiveRecord::Base
  include Alchemy::Taggable

  validates_presence_of :name
  belongs_to :location
  before_destroy :abort_if_name_is_undestructible

  scope :starting_today, -> { where(starts_at: Time.current.at_midnight..Date.tomorrow.at_midnight) }
  scope :future, -> { where("starts_at > ?", Date.tomorrow.at_midnight) }

  def self.alchemy_resource_relations
    {
      location: {attr_method: "name", attr_type: "string"},
    }
  end

  def self.alchemy_resource_filters
    %w(starting_today future)
  end<commit_msg>Make Event (test model) adopt new resource filter structure<commit_after># frozen_string_literal: true

class Event < ActiveRecord::Base
  include Alchemy::Taggable

  validates_presence_of :name
  belongs_to :location
  before_destroy :abort_if_name_is_undestructible

  scope :starting_today, -> { where(starts_at: Time.current.at_midnight..Date.tomorrow.at_midnight) }
  scope :future, -> { where("starts_at > ?", Date.tomorrow.at_midnight) }

  def self.alchemy_resource_relations
    {
      location: {attr_method: "name", attr_type: "string"},
    }
  end

  def self.alchemy_resource_filters
    [
      {
        name: :start,
        values: %w(starting_today future)
      }
    ]
  end
{'fraction_non_alphanumeric': 0.1026438569206843, 'fraction_numerical': 0.0, 'mean_word_length': 4.189516129032258, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3805555', 'n_tokens_mistral': 452, 'n_tokens_neox': 431, 'n_words': 80}