<commit_before>require 'casino_core/model'

class CASinoCore::Model::TicketGrantingTicket < ActiveRecord::Base
  attr_accessible :ticket, :username, :user_agent, :extra_attributes
  serialize :extra_attributes, Hash
  validates :ticket, uniqueness: true
  has_many :service_tickets
  has_many :proxy_granting_tickets
end<commit_msg>Added method to extract some human-readable browser info<commit_after>require 'casino_core/model'

class CASinoCore::Model::TicketGrantingTicket < ActiveRecord::Base
  attr_accessible :ticket, :username, :user_agent, :extra_attributes
  serialize :extra_attributes, Hash
  validates :ticket, uniqueness: true
  has_many :service_tickets
  has_many :proxy_granting_tickets

  def browser_info
    user_agent = UserAgent.parse(self.user_agent)
    "#{user_agent.browser} (#{user_agent.platform})"
  end
end
{'fraction_non_alphanumeric': 0.0861244019138756, 'fraction_numerical': 0.0, 'mean_word_length': 7.205882352941177, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3623689', 'n_tokens_mistral': 275, 'n_tokens_neox': 257, 'n_words': 57}