Class: Ticketable::InstallGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/ticketable/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/ticketable/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

#generate_installObject



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

def generate_install
  template "ticket.rb", "app/models/ticket.rb"
  migration_template "create_tickets.rb", "db/migrate/create_tickets.rb"
end