Class: FlowState::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- FlowState::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/flow_state/install_generator.rb
Overview
Generates migrations for FlowState
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(_dirname) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/generators/flow_state/install_generator.rb', line 23 def self.next_migration_number(_dirname) @call_count ||= 0 = Time.now.utc.strftime('%Y%m%d%H%M%S').to_i migration_number = + @call_count @call_count += 1 migration_number.to_s end |
Instance Method Details
#create_migrations ⇒ Object
16 17 18 19 20 21 |
# File 'lib/generators/flow_state/install_generator.rb', line 16 def create_migrations migration_template 'create_flow_state_flows.rb', 'db/migrate/create_flow_state_flows.rb' migration_template 'create_flow_state_flow_transitions.rb', 'db/migrate/create_flow_state_flow_transitions.rb' migration_template 'create_flow_state_transition_artefacts.rb', 'db/migrate/create_flow_state_transition_artefacts.rb' end |