lib/generators/rating/install_generator.rb in rating-0.1.0 vs lib/generators/rating/install_generator.rb in rating-0.2.0

- old
+ new

@@ -2,14 +2,18 @@ module Rating class InstallGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) - desc 'configure Rating' + desc 'creates Rating migration' def create_migration - version = Time.current.strftime('%Y%m%d%H%M%S') + template 'db/migrate/create_rating_tables.rb', "db/migrate/#{timestamp}_create_rating_tables.rb" + end - template 'db/migrate/create_rating_tables.rb', "db/migrate/#{version}_create_rating_tables.rb" + private + + def timestamp + Time.current.strftime '%Y%m%d%H%M%S' end end end