Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rails/generators/active_record/migration/migration_generator'
- class LogMigrationGenerator < ActiveRecord::Generators::MigrationGenerator
- include Rails::Generators::Actions
- source_root File.join(File.dirname(ActiveRecord::Generators::MigrationGenerator.instance_method(:create_migration_file).source_location.first), "templates")
- def create_migration_file
- set_local_assigns!
- validate_file_name!
- migration_template @migration_template, "db_log/migrate/#{file_name}.rb"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement