Class: GeoserverMigrations::Generators::AddGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- GeoserverMigrations::Generators::AddGenerator
- Defined in:
- lib/generators/geoserver_migrations/add/add_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_migration ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/geoserver_migrations/add/add_generator.rb', line 8 def add_migration migration_name = file_name.underscore class_name = file_name.camelize create_file File.join(Rails.root, GeoserverMigrations.migrations_rootpath, "#{Time.now.strftime('%Y%m%d%H%M%S')}_#{migration_name}.rb"), <<-MIGRATION_FILE class #{class_name} < GeoserverMigrations::Migration def run # add migration code here end end MIGRATION_FILE end |