<commit_before>class Event < ItemTemplate
  belongs_to :challenge
  has_one :item_template, :as => :item
  
#  belongs_to :question
#  belongs_to :user
#  belongs_to :categories
#  belongs_to :challenge
#  attr_accessor :lat
#  attr_accessor :lng
  
#  validates :categories_id, :presence => true
  
#  has_many :response_events
#  has_many :followed_events
  
  scope :followed, lambda{|key| {:conditions => {:id => key}}}
  
  scope :has_category,       lambda{ |n| { :conditions => { :categories_id => n}}}
  scope :has_title, lambda{|name| {:conditions => ["title LIKE ? OR title LIKE ? OR title LIKE ?", "% " + name + " %", name, name + " %"]}}
  scope :keyword, lambda{|key| { :conditions => ["title LIKE ? OR title LIKE ? OR title LIKE ? OR description LIKE ? OR description LIKE ? OR description LIKE ?", "% " + key + " %", key, key + " %", "% " + key + " %", key, key + " %" ]}}

  #before_save :upkeep

  def category_id<commit_msg>this works ima be pissed<commit_after>class Event < ActiveRecord::Base
  belongs_to :challenge
 
  
#  belongs_to :question
#  belongs_to :user
#  belongs_to :categories
#  belongs_to :challenge
#  attr_accessor :lat
#  attr_accessor :lng
  
#  validates :categories_id, :presence => true
  
#  has_many :response_events
#  has_many :followed_events
  
  scope :followed, lambda{|key| {:conditions => {:id => key}}}
  
  scope :has_category,       lambda{ |n| { :conditions => { :categories_id => n}}}
  scope :has_title, lambda{|name| {:conditions => ["title LIKE ? OR title LIKE ? OR title LIKE ?", "% " + name + " %", name, name + " %"]}}
  scope :keyword, lambda{|key| { :conditions => ["title LIKE ? OR title LIKE ? OR title LIKE ? OR description LIKE ? OR description LIKE ? OR description LIKE ?", "% " + key + " %", key, key + " %", "% " + key + " %", key, key + " %" ]}}

  #before_save :upkeep

  def category_id
{'fraction_non_alphanumeric': 0.15987124463519314, 'fraction_numerical': 0.0, 'mean_word_length': 3.83160621761658, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '6771422', 'n_tokens_mistral': 652, 'n_tokens_neox': 616, 'n_words': 175}