<commit_before>class CreateRoles < ActiveRecord::Migration
  def up
    create_table :roles do |t|
      t.string :name
      t.timestamps
    end

    create_roles
  end

  def down
    drop_table :roles
  end


  def create_roles
    SimpleRoles::Configuration.valid_roles.each do |role|
      Role.create(:name => role.to_s)
    end
  end
end
<commit_msg>change role migration to set name attribute directly as mass-assignment protection in latest Rails causes migration to fail<commit_after>class CreateRoles < ActiveRecord::Migration
  def up
    create_table :roles do |t|
      t.string :name
      t.timestamps
    end

    create_roles
  end

  def down
    drop_table :roles
  end


  def create_roles
    SimpleRoles::Configuration.valid_roles.each do |role|
      r = Role.new
      r.name = role.to_s
      r.save
    end
  end
end

{'fraction_non_alphanumeric': 0.06153846153846154, 'fraction_numerical': 0.0, 'mean_word_length': 2.6943231441048034, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '3926305', 'n_tokens_mistral': 283, 'n_tokens_neox': 275, 'n_words': 80}