<commit_before>class AssignedSection < ActiveRecord::Base
  belongs_to :article
  belongs_to :section, :counter_cache => 'articles_count'
  acts_as_list :scope => 'section_id = #{section_id}'
  validates_presence_of :article_id, :section_id
  validate_on_create    :check_for_dupe_article_and_section

  protected
    def check_for_dupe_article_and_section
      unless self.class.count(['article_id = ? and section_id = ?', article_id, section_id]).zero?
        errors.add_to_base("Cannot have a duplicate categorization for this article and section")
      end
    end<commit_msg>fix deprecated use of #count<commit_after>class AssignedSection < ActiveRecord::Base
  belongs_to :article
  belongs_to :section, :counter_cache => 'articles_count'
  acts_as_list :scope => 'section_id = #{section_id}'
  validates_presence_of :article_id, :section_id
  validate_on_create    :check_for_dupe_article_and_section

  protected
    def check_for_dupe_article_and_section
      unless self.class.count(:all, :conditions => ['article_id = ? and section_id = ?', article_id, section_id]).zero?
        errors.add_to_base("Cannot have a duplicate categorization for this article and section")
      end
    end
{'fraction_non_alphanumeric': 0.08485856905158069, 'fraction_numerical': 0.0, 'mean_word_length': 5.137755102040816, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '6319370', 'n_tokens_mistral': 373, 'n_tokens_neox': 371, 'n_words': 83}