<commit_before>module ActsAsAccount
  class Account < ActiveRecord::Base
    set_table_name :acts_as_account_accounts
    
    belongs_to :holder, :polymorphic => true
    has_many :postings
    has_many :journals, :through => :postings
    
    validates_presence_of :holder
    
    class << self
      def for(name)
        GlobalAccount.find_or_create_by_name(name.to_s).account
      end

      def create!(attributes = nil)
        find_on_error(attributes) do
          super
        end
      end<commit_msg>* remove holder-validation as this causes problems with acts_as_paranoid.<commit_after>module ActsAsAccount
  class Account < ActiveRecord::Base
    set_table_name :acts_as_account_accounts
    
    belongs_to :holder, :polymorphic => true
    has_many :postings
    has_many :journals, :through => :postings

    # TODO: discuss with norman: 
    # validates_presence_of will force an ActiveRecord::find on the object
    # but we have to create accounts for deleted holder!
    #
    # validates_presence_of :holder
    
    class << self
      def for(name)
        GlobalAccount.find_or_create_by_name(name.to_s).account
      end

      def create!(attributes = nil)
        find_on_error(attributes) do
          super
        end
      end
{'fraction_non_alphanumeric': 0.06576862123613313, 'fraction_numerical': 0.0, 'mean_word_length': 2.827272727272727, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '4798655', 'n_tokens_mistral': 384, 'n_tokens_neox': 375, 'n_words': 94}