<commit_before>class Dataservice::ConsoleLogger < ActiveRecord::Base
  self.table_name = :dataservice_console_loggers
  
  has_one  :learner, :class_name => "Portal::Learner"
  has_many :console_contents, -> { order :position },
    :class_name => "Dataservice::ConsoleContent",
    :dependent => :destroy
  has_one :last_console_content, -> { order 'position DESC' }
    :class_name:  "Dataservice::ConsoleContent"

  include Changeable

  # pagination default
  cattr_reader :per_page
  @@per_page = 5
  
  self.extend SearchableModel
  
  @@searchable_attributes = %w{updated_at}

  class <<self
    def searchable_attributes
      @@searchable_attributes
    end

  end

  # for the view system ...
  def user
    nil
  end
  
  def name
    if learner = self.learner
      user = learner.student.user
      name = user.name
      login = user.login
      runnable_name = (learner.offering.runnable ? learner.offering.runnable.name : "invalid offering runnable")
      "#{user.login}: (#{user.name}), #{runnable_name}, #{self.console_contents.count} sessions"
    else
      "no associated learner"
    end
  end

end
<commit_msg>Fixed missing comma in existing conditions update<commit_after>class Dataservice::ConsoleLogger < ActiveRecord::Base
  self.table_name = :dataservice_console_loggers

  has_one  :learner, :class_name => "Portal::Learner"
  has_many :console_contents, -> { order :position },
    :class_name => "Dataservice::ConsoleContent",
    :dependent => :destroy
  has_one :last_console_content, -> { order 'position DESC' },
    :class_name =>  "Dataservice::ConsoleContent"

  include Changeable

  # pagination default
  cattr_reader :per_page
  @@per_page = 5

  self.extend SearchableModel

  @@searchable_attributes = %w{updated_at}

  class <<self
    def searchable_attributes
      @@searchable_attributes
    end

  end

  # for the view system ...
  def user
    nil
  end

  def name
    if learner = self.learner
      user = learner.student.user
      name = user.name
      login = user.login
      runnable_name = (learner.offering.runnable ? learner.offering.runnable.name : "invalid offering runnable")
      "#{user.login}: (#{user.name}), #{runnable_name}, #{self.console_contents.count} sessions"
    else
      "no associated learner"
    end
  end

end

{'fraction_non_alphanumeric': 0.10526315789473684, 'fraction_numerical': 0.0008699434536755111, 'mean_word_length': 3.4921875, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, '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': '7549821', 'n_tokens_mistral': 756, 'n_tokens_neox': 722, 'n_words': 166}