Class: Survey::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/survey/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_migrationObject


6
7
8
9
10
11
# File 'lib/generators/survey/install_generator.rb', line 6

def copy_migration
  unless survey_migration_already_exists?
    timestamp_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
    copy_file "migration.rb", "db/migrate/#{timestamp_number}_create_survey.rb"
  end
end