diff --git a/lib/generators/rating/install_generator.rb b/lib/generators/rating/install_generator.rb index 5332239..84930b3 100644 --- a/lib/generators/rating/install_generator.rb +++ b/lib/generators/rating/install_generator.rb @@ -4,12 +4,16 @@ 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