module Scrivito module Generators class MigrationGenerator < ::Rails::Generators::NamedBase include ::Rails::Generators::Migration source_root File.expand_path('../templates', __FILE__) def self.next_migration_number(dirname) Scrivito::Migration.next_migration_number(current_migration_number(dirname)) end def generate_migration migration_template 'migration.erb', File.join(Scrivito::Configuration.migration_path, "#{file_name}_migration.rb") end end end end