<commit_before>class ContentBlock < ActiveRecord::Base

  belongs_to :parent, polymorphic: true

  @@block_types = Dir.glob("#{Rails.root}/app/models/**/*_block.rb").collect do |block|
    block.gsub(/.*\//, '').gsub('.rb', '').to_sym
  end
  
  @@block_types.each do |block_type|
    has_one block_type, dependent: :destroy
    accepts_nested_attributes_for block_type
  end

  def path_name
    self.block_type.underscore
  end
  
  def as_json(options = {})
    options.reverse_merge! only: [:id], include: @@block_types
    super(options)
  end

  def self.block_types
    @@block_types
  end

  def self.block_list_from_files
    blocks = Dir.glob("#{Rails.root}/app/models/*_block.rb")

    blocks.collect do |block|
      block.gsub!(/.*\//, '').gsub!('.rb', '').to_sym
    end
  end

end<commit_msg>remove gsub bang methods from class method<commit_after>class ContentBlock < ActiveRecord::Base

  belongs_to :parent, polymorphic: true

  @@block_types = Dir.glob("#{Rails.root}/app/models/**/*_block.rb").collect do |block|
    block.gsub(/.*\//, '').gsub('.rb', '').to_sym
  end
  
  @@block_types.each do |block_type|
    has_one block_type, dependent: :destroy
    accepts_nested_attributes_for block_type
  end

  def path_name
    self.block_type.underscore
  end
  
  def as_json(options = {})
    options.reverse_merge! only: [:id], include: @@block_types
    super(options)
  end

  def self.block_types
    @@block_types
  end

  def self.block_list_from_files
    blocks = Dir.glob("#{Rails.root}/app/models/*_block.rb")

    blocks.collect do |block|
      block.gsub(/.*\//, '').gsub('.rb', '').to_sym
    end
  end

end
{'fraction_non_alphanumeric': 0.15356489945155394, 'fraction_numerical': 0.0, 'mean_word_length': 3.4021447721179623, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3366509', 'n_tokens_mistral': 603, 'n_tokens_neox': 579, 'n_words': 115}