<commit_before># == Schema Information
#
# Table name: groups
#
#  id                        :integer       not null, primary key
#  name                      :string(100)   
#  description               :text          
#  meets                     :string(100)   
#  location                  :string(100)   
#  directions                :text          
#  other_notes               :text          
#  category                  :string(50)    
#  creator_id                :integer       
#  private                   :boolean       
#  address                   :string(255)   
#  members_send              :boolean       default(TRUE)
#  leader_id                 :integer       
#  updated_at                :datetime      
#  hidden                    :boolean       
#  approved                  :boolean       
#  link_code                 :string(255)   
#  parents_of                :integer       
#  site_id                   :integer       
#  blog                      :boolean       default(TRUE)
#  email                     :boolean       default(TRUE)
#  prayer                    :boolean       default(TRUE)
#  attendance                :boolean       default(TRUE)
#  legacy_id                 :integer       
#  gcal_private_link         :string(255)   
#  approval_required_to_join :boolean       default(TRUE)
#  pictures                  :boolean       default(TRUE)
#

class Group < ActiveRecord::Base
  has_many :memberships, :dependent => :destroy
  has_many :membership_requests, :dependent => :destroy
  has_many :people, :through => :memberships, :order => 'last_name, first_name'
  has_many :admins, :through => :memberships, :source => :person, :order => 'last_name, first_name', :conditions => ['memberships.admin = ?', true]
  has_many :messages, :conditions => 'parent_id is null', :order => 'updated_at desc', :dependent => :destroy
  has_many :notes, :order => 'created_at desc'
  has_many :prayer_requests, :order => 'created_at desc'
  has_many :attendance_records
  has_many :albums
  has_many :stream_items
  belongs_to :creator, :class_name => 'Person', :foreign_key => 'creator_id'
  belongs_to :leader, :class_name => 'Person', :foreign_key => 'leader_id'
  belongs_to :parents_of_group, :class_name => 'Group', :foreign_key => 'parents_of'
  belongs_to :site
  
  scope_by_site_id
  <commit_msg>Group deletion should delete all corresponding StreamItems.<commit_after># == Schema Information
#
# Table name: groups
#
#  id                        :integer       not null, primary key
#  name                      :string(100)   
#  description               :text          
#  meets                     :string(100)   
#  location                  :string(100)   
#  directions                :text          
#  other_notes               :text          
#  category                  :string(50)    
#  creator_id                :integer       
#  private                   :boolean       
#  address                   :string(255)   
#  members_send              :boolean       default(TRUE)
#  leader_id                 :integer       
#  updated_at                :datetime      
#  hidden                    :boolean       
#  approved                  :boolean       
#  link_code                 :string(255)   
#  parents_of                :integer       
#  site_id                   :integer       
#  blog                      :boolean       default(TRUE)
#  email                     :boolean       default(TRUE)
#  prayer                    :boolean       default(TRUE)
#  attendance                :boolean       default(TRUE)
#  legacy_id                 :integer       
#  gcal_private_link         :string(255)   
#  approval_required_to_join :boolean       default(TRUE)
#  pictures                  :boolean       default(TRUE)
#

class Group < ActiveRecord::Base
  has_many :memberships, :dependent => :destroy
  has_many :membership_requests, :dependent => :destroy
  has_many :people, :through => :memberships, :order => 'last_name, first_name'
  has_many :admins, :through => :memberships, :source => :person, :order => 'last_name, first_name', :conditions => ['memberships.admin = ?', true]
  has_many :messages, :conditions => 'parent_id is null', :order => 'updated_at desc', :dependent => :destroy
  has_many :notes, :order => 'created_at desc'
  has_many :prayer_requests, :order => 'created_at desc'
  has_many :attendance_records
  has_many :albums
  has_many :stream_items, :dependent => :destroy
  belongs_to :creator, :class_name => 'Person', :foreign_key => 'creator_id'
  belongs_to :leader, :class_name => 'Person', :foreign_key => 'leader_id'
  belongs_to :parents_of_group, :class_name => 'Group', :foreign_key => 'parents_of'
  belongs_to :site
  
  scope_by_site_id
  
{'fraction_non_alphanumeric': 0.0968421052631579, 'fraction_numerical': 0.008421052631578947, 'mean_word_length': 1.7257601835915088, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '5130926', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1311, 'n_words': 306}