Class: StateMachineTransactionsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- StateMachineTransactionsGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/state_machine_transactions_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
11 12 13 |
# File 'lib/generators/state_machine_transactions_generator.rb', line 11 def next_migration_number path Time.now.utc.strftime("%Y%m%d%H%M%S") end |
.source_root ⇒ Object
7 8 9 |
# File 'lib/generators/state_machine_transactions_generator.rb', line 7 def source_root @_state_machine_transactions_source_root ||= File.('../templates', __FILE__) end |
Instance Method Details
#create_model_file ⇒ Object
16 17 18 |
# File 'lib/generators/state_machine_transactions_generator.rb', line 16 def create_model_file migration_template 'create_state_machines_transactions.rb', 'db/migrate/create_state_machines_transactions.rb' end |