Class: Seqseq::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/seqseq/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



11
12
13
# File 'lib/generators/seqseq/install_generator.rb', line 11

def self.next_migration_number(path)
  Time.now.utc.strftime('%Y%m%d%H%M%S')
end

Instance Method Details

#create_filesObject



15
16
17
18
# File 'lib/generators/seqseq/install_generator.rb', line 15

def create_files
  template "seqseq.rb", "app/models/#{file_name}.rb"
  migration_template 'install_seqseq.rb', 'db/migrate/install_seqseq.rb'
end