<commit_before># == Schema Information
# Schema version: 20100707152350
#
# Table name: users
#
#  id                :integer         not null, primary key
#  name              :string(255)
#  email             :string(255)
#  created_at        :datetime
#  updated_at        :datetime
#  wants_fmt_updates :boolean
#

class User < ActiveRecord::Base
  validates_presence_of :email
  validates_presence_of :name, :unless => :unregistered?
  validates_format_of :email, :with => Regexp.new("^#{MySociety::Validate.email_match_regexp}\$")
  validates_uniqueness_of :email
  attr_protected :password, :password_confirmation, :is_expert
  has_many :assignments
  has_many :campaign_supporters, :foreign_key => :supporter_id
  has_many :campaigns, :through => :campaign_supporters
  has_many :initiated_campaigns, :foreign_key => :initiator_id, :class_name => 'Campaign'
  has_many :sent_emails, :as => :recipient
  before_save :generate_email_local_part, :unless => :unregistered?
  has_attached_file :profile_photo,
                    :path => "#{MySociety::Config.get('OPTION_FILE_DIRECTORY', ':rails_root/public/system')}/paperclip/:class/:attachment/:id/:style/:filename",
                    :url => "#{MySociety::Config.get('OPTION_PAPERCLIP_URL_BASE', '/system')}/paperclip/:class/:attachment/:id/:style/:filename",
                    :default_url => "/images/paperclip_defaults/:class/:attachment/missing_:style.png",
                    :styles => { :large_thumb => "70x70#",
                                 :small_thumb => "40x40#" }

  attr_accessor :ignore_blank_passwords


  acts_as_authentic do |c|
    # we validate the email with activerecord validation above
    c.validate_email_field = false
    c.merge_validates_confirmation_of_password_field_options({:unless => :unregistered?,
                                                              :message => I18n.translate(:password_match_error)})
    password_min_length = 5
    c.merge_validates_length_of_password_field_options({:unless => :unregistered?,
                                                        :minimum => password_min_length,<commit_msg>Bugfix - config option syntax<commit_after># == Schema Information
# Schema version: 20100707152350
#
# Table name: users
#
#  id                :integer         not null, primary key
#  name              :string(255)
#  email             :string(255)
#  created_at        :datetime
#  updated_at        :datetime
#  wants_fmt_updates :boolean
#

class User < ActiveRecord::Base
  validates_presence_of :email
  validates_presence_of :name, :unless => :unregistered?
  validates_format_of :email, :with => Regexp.new("^#{MySociety::Validate.email_match_regexp}\$")
  validates_uniqueness_of :email
  attr_protected :password, :password_confirmation, :is_expert
  has_many :assignments
  has_many :campaign_supporters, :foreign_key => :supporter_id
  has_many :campaigns, :through => :campaign_supporters
  has_many :initiated_campaigns, :foreign_key => :initiator_id, :class_name => 'Campaign'
  has_many :sent_emails, :as => :recipient
  before_save :generate_email_local_part, :unless => :unregistered?
  has_attached_file :profile_photo,
                    :path => "#{MySociety::Config.get('FILE_DIRECTORY', ':rails_root/public/system')}/paperclip/:class/:attachment/:id/:style/:filename",
                    :url => "#{MySociety::Config.get('PAPERCLIP_URL_BASE', '/system')}/paperclip/:class/:attachment/:id/:style/:filename",
                    :default_url => "/images/paperclip_defaults/:class/:attachment/missing_:style.png",
                    :styles => { :large_thumb => "70x70#",
                                 :small_thumb => "40x40#" }

  attr_accessor :ignore_blank_passwords


  acts_as_authentic do |c|
    # we validate the email with activerecord validation above
    c.validate_email_field = false
    c.merge_validates_confirmation_of_password_field_options({:unless => :unregistered?,
                                                              :message => I18n.translate(:password_match_error)})
    password_min_length = 5
    c.merge_validates_length_of_password_field_options({:unless => :unregistered?,
                                                        :minimum => password_min_length,
{'fraction_non_alphanumeric': 0.11359360301034807, 'fraction_numerical': 0.01458137347130762, 'mean_word_length': 3.0351043643263758, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '762374', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1265, 'n_words': 218}