SHARE
TWEET

Untitled

a guest Mar 3rd, 2017 107 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top