Guest User

Untitled

a guest
Mar 3rd, 2017
116
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'rails/generators/active_record/migration/migration_generator'
  2.  
  3. class LogMigrationGenerator < ActiveRecord::Generators::MigrationGenerator
  4.   include Rails::Generators::Actions
  5.   source_root File.join(File.dirname(ActiveRecord::Generators::MigrationGenerator.instance_method(:create_migration_file).source_location.first), "templates")
  6.  
  7.   def create_migration_file
  8.     set_local_assigns!
  9.     validate_file_name!
  10.     migration_template @migration_template, "db_log/migrate/#{file_name}.rb"
  11.   end
  12. end
RAW Paste Data