Class: Taskgration::Generators::CreateGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/taskgration/create_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_file_to_main_appObject



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_nameObject



13
14
15
# File 'lib/generators/taskgration/create_generator.rb', line 13

def set_file_name
  @file_name = "#{@version}_#{name.underscore}"
end

#set_versionObject



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