require 'rails/generators' require 'rails/generators/active_record' require 'rails/generators/migration' class LadyJosephineMigrationGenerator < Rails::Generators::NamedBase include Rails::Generators::Migration source_root File.expand_path('../templates', __FILE__) def self.next_migration_number(path) Time.now.utc.strftime("%Y%m%d%H%M%S") end def copy_model_migration migration_template "migration.rb", "db/migrate/add_lady_josephine_to_#{table_name}.rb" end end