<commit_before>require 'rails/generators/active_record/migration'

class IrwiWikiGenerator < Rails::Generators::Base

  include Rails::Generators::Migration
  extend ActiveRecord::Generators::Migration

  source_root File.expand_path("../templates", __FILE__)

  def generate_wiki

    # Controllers
    copy_file 'controllers/wiki_pages_controller.rb', 'app/controllers/wiki_pages_controller.rb'

    # Helpers
    copy_file 'helpers/wiki_pages_helper.rb', 'app/helpers/wiki_pages_helper.rb'

    # Models
    copy_file 'models/wiki_page.rb',         'app/models/wiki_page.rb'
    copy_file 'models/wiki_page_version.rb', 'app/models/wiki_page_version.rb'

    # Migrations
    migration_template 'migrate/create_wiki_pages.rb', 'db/migrate/create_wiki_pages'

    # Routes
    route "wiki_root '/wiki'"
  end

end<commit_msg>Fix generator for activerecord migration file for Rails4<commit_after>require 'rails/generators/active_record'

class IrwiWikiGenerator < Rails::Generators::Base

  include Rails::Generators::Migration

  source_root File.expand_path("../templates", __FILE__)

  def generate_wiki

    # Controllers
    copy_file 'controllers/wiki_pages_controller.rb', 'app/controllers/wiki_pages_controller.rb'

    # Helpers
    copy_file 'helpers/wiki_pages_helper.rb', 'app/helpers/wiki_pages_helper.rb'

    # Models
    copy_file 'models/wiki_page.rb',         'app/models/wiki_page.rb'
    copy_file 'models/wiki_page_version.rb', 'app/models/wiki_page_version.rb'

    # Migrations
    migration_template 'migrate/create_wiki_pages.rb', 'db/migrate/create_wiki_pages'

    # Routes
    route "wiki_root '/wiki'"
  end
  
  def self.next_migration_number dirname
    ActiveRecord::Generators::Base.next_migration_number dirname
  end

end
{'fraction_non_alphanumeric': 0.10187820147979511, 'fraction_numerical': 0.0005691519635742744, 'mean_word_length': 4.528301886792453, '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': '4547326', 'n_tokens_mistral': 588, 'n_tokens_neox': 575, 'n_words': 88}