<commit_before>require 'rails/generators'
require 'rails/generators/migration'     
 
class MigrationForGenerator < Rails::Generators::Base
  include Rails::Generators::Migration

  argument :commands, :type => :array
  source_root File.expand_path('../templates', __FILE__) 

  #available tranformations with their arity
  AVAILABLE_COMMANDS = { 
    :create_table => 1,
    :rename_table => 2,
    :drop_table => 1,
    :add_column => 3,
    :rename_column => 3,
    :change_column => 3,
    :remove_column => 3,
    :add_index => 2,
    :remove_index => 2,
  }


  def self.next_migration_number(dirname)
    if ActiveRecord::Base.timestamped_migrations
      Time.now.utc.strftime("%Y%m%d%H%M%S")
    else
      "%.3d" % (current_migration_number(dirname) + 1)
    end
  end

  def migration_name
    commands.join.gsub(' ','_').gsub(':', '_')
  end  <commit_msg>fixed incorrect arity for remove_column<commit_after>require 'rails/generators'
require 'rails/generators/migration'     
 
class MigrationForGenerator < Rails::Generators::Base
  include Rails::Generators::Migration

  argument :commands, :type => :array
  source_root File.expand_path('../templates', __FILE__) 

  #available tranformations with their arity
  AVAILABLE_COMMANDS = { 
    :create_table => 1,
    :rename_table => 2,
    :drop_table => 1,
    :add_column => 3,
    :rename_column => 3,
    :change_column => 3,
    :remove_column => 2,
    :add_index => 2,
    :remove_index => 2,
  }


  def self.next_migration_number(dirname)
    if ActiveRecord::Base.timestamped_migrations
      Time.now.utc.strftime("%Y%m%d%H%M%S")
    else
      "%.3d" % (current_migration_number(dirname) + 1)
    end
  end

  def migration_name
    commands.join.gsub(' ','_').gsub(':', '_')
  end  
{'fraction_non_alphanumeric': 0.1375, 'fraction_numerical': 0.0125, 'mean_word_length': 3.622047244094488, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '3628786', 'n_tokens_mistral': 644, 'n_tokens_neox': 601, 'n_words': 116}