Class: Taskgration::Generators::CreateGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Taskgration::Generators::CreateGenerator
- Defined in:
- lib/generators/taskgration/create_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_file_to_main_app ⇒ Object
17 18 19 |
# File 'lib/generators/taskgration/create_generator.rb', line 17 def copy_file_to_main_app template('create.rb.tt', "lib/tasks/migrations/#{@file_name}.rb") end |
#set_file_name ⇒ Object
13 14 15 |
# File 'lib/generators/taskgration/create_generator.rb', line 13 def set_file_name @file_name = "#{@version}_#{name.underscore}" end |
#set_version ⇒ Object
9 10 11 |
# File 'lib/generators/taskgration/create_generator.rb', line 9 def set_version @version = Time.now.strftime("%Y%m%d%H%M%S") end |