<commit_before>require 'grouped_pagination'
require 'rfc822'

class Person < ActiveRecord::Base

  include Seek::Rdf::RdfGeneration

  acts_as_yellow_pages
  default_scope order("#{table_name}.last_name, #{table_name}.first_name")

  #those that have updated time stamps and avatars appear first. A future enhancement could be to judge activity by last asset updated timestamp
  scope :active, :order=> "avatar_id is null, updated_at DESC"

  before_save :first_person_admin
  before_destroy :clean_up_and_assign_permissions

  acts_as_notifiee
  acts_as_annotatable :name_field=>:name

  after_save :queue_update_auth_table

  def queue_update_auth_table
    if changes.include?("roles_mask")
      AuthLookupUpdateJob.add_items_to_queue self
    end
  end

  include Seek::Taggable

  def receive_notifications
    registered? and super
  end
  
  def registered?<commit_msg>fix to get people ordered by active whilst ignoring the default scope<commit_after>require 'grouped_pagination'
require 'rfc822'

class Person < ActiveRecord::Base

  include Seek::Rdf::RdfGeneration

  acts_as_yellow_pages
  default_scope order("#{table_name}.last_name, #{table_name}.first_name")

  before_save :first_person_admin
  before_destroy :clean_up_and_assign_permissions

  acts_as_notifiee
  acts_as_annotatable :name_field=>:name

  after_save :queue_update_auth_table

  def queue_update_auth_table
    if changes.include?("roles_mask")
      AuthLookupUpdateJob.add_items_to_queue self
    end
  end

  #those that have updated time stamps and avatars appear first. A future enhancement could be to judge activity by last asset updated timestamp
  def self.active
    Person.unscoped.order("avatar_id is null, updated_at DESC")
  end

  include Seek::Taggable

  def receive_notifications
    registered? and super
  end
  
  def registered?
{'fraction_non_alphanumeric': 0.05994550408719346, 'fraction_numerical': 0.0032697547683923707, 'mean_word_length': 5.1404682274247495, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '6159361', 'n_tokens_mistral': 591, 'n_tokens_neox': 564, 'n_words': 152}