<commit_before>class ActiveRecord::Base

  # Build a record unsafely, bypassing attr_accessible.
  # This is useful in tests and in the console.
  def self.unsafe_build(attrs)
    o = new
    o.unsafe_attributes = attrs
    o
  end
  
  def self.unsafe_create(attrs)
    o = unsafe_build(attrs)
    o.save
    o
  end

  def unsafe_attributes=(attrs)
    attrs.each do |(k,v)|
      send("#{k}=", v)
    end
  end
end<commit_msg>Added unsafe_create!<commit_after>class ActiveRecord::Base

  # Build a record unsafely, bypassing attr_accessible.
  # This is useful in tests and in the console.
  def self.unsafe_build(attrs)
    o = new
    o.unsafe_attributes = attrs
    o
  end
  
  def self.unsafe_create(attrs)
    o = unsafe_build(attrs)
    o.save
    o
  end
  
  def self.unsafe_create!(attrs)
    o = unsafe_build(attrs)
    o.save!
  end

  def unsafe_attributes=(attrs)
    attrs.each do |(k,v)|
      send("#{k}=", v)
    end
  end
end
{'fraction_non_alphanumeric': 0.09714889123548047, 'fraction_numerical': 0.0, 'mean_word_length': 2.792, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6122828', 'n_tokens_mistral': 344, 'n_tokens_neox': 332, 'n_words': 90}