Class: PluginMigrationGenerator
- Inherits:
-
Rails::Generator::Base
- Object
- Rails::Generator::Base
- PluginMigrationGenerator
- Defined in:
- vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb
Overview
Generates a migration which migrates all plugins to their latest versions within the database.
Constant Summary
- MAX_FILENAME_LENGTH =
255 characters max for Windows NTFS (http://en.wikipedia.org/wiki/Filename) minus 14 for timestamp, minus some extra chars for dot, underscore, file extension. So let’s have 230.
230
Instance Method Summary
-
- (PluginMigrationGenerator) initialize(runtime_args, runtime_options = {})
constructor
A new instance of PluginMigrationGenerator.
- - (Object) manifest
Constructor Details
- (PluginMigrationGenerator) initialize(runtime_args, runtime_options = {})
A new instance of PluginMigrationGenerator
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb', line 10 def initialize(runtime_args, ={}) super = {:assigns => {}} ensure_schema_table_exists get_plugins_to_migrate(runtime_args) if @plugins_to_migrate.empty? puts "All plugins are migrated to their latest versions" exit(0) end [:migration_file_name] = build_migration_name [:assigns][:class_name] = build_migration_name.classify end |
Instance Method Details
- (Object) manifest
25 26 27 28 29 |
# File 'vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb', line 25 def manifest record do |m| m.migration_template 'plugin_migration.erb', 'db/migrate', end end |